Developer tool

JSON Formatter & Validator

Paste JSON to beautify, minify, validate and explore it in a collapsible tree — with exact error line and column — free, private and offline in your browser.

100% free No upload — runs on your device Works offline
Indent

How to format and validate JSON

  1. Paste JSON into the input box, or open a .json file.
  2. Choose an indent and click Format, or click Minify. Errors are shown with the exact line and column.
  3. Explore the result in the tree view, then copy it or download it as a .json file.

What is JSON Formatter & Validator?

A JSON formatter (also called a beautifier or pretty-printer) re-indents JSON so it is easy to read, and a validator checks that it follows the JSON standard (RFC 8259). This tool does both, plus minifying, alphabetical key sorting and a collapsible tree viewer.

Validation uses your browser's native JSON.parse, the same strict parser web apps use. When JSON is invalid the tool reports the line and column of the error and highlights it in the input. Common causes are trailing commas, single quotes, unquoted keys and comments, none of which are allowed in standard JSON.

All processing happens locally; your JSON is never uploaded, which makes it safe for API keys and private data. Multi-megabyte files work because the tree view renders nodes only when you expand them.

Frequently asked questions

How do I find the error in invalid JSON?

Click Validate or Format. If the JSON is invalid, the tool shows the parser message with the line and column number and selects the error position in the input box.

What is the difference between format and minify?

Format (beautify) adds line breaks and indentation for readability. Minify removes all unnecessary whitespace to make the JSON as small as possible for transfer or storage.

Why is my JSON invalid?

The most common causes are trailing commas, single-quoted strings, unquoted property names, comments and special values like NaN or undefined. Standard JSON allows none of these.

Can it sort JSON keys?

Yes. Turn on Sort keys and the formatter orders object keys alphabetically at every level. Array order is never changed.

Is my JSON sent to a server?

No. Parsing and formatting run entirely in your browser with JavaScript, so your data never leaves your device and the tool works offline.

How large a JSON file can it handle?

Files of tens of megabytes work on most devices. The limit is your device's memory; the tree view stays fast because it only renders the nodes you expand.

Related tools