JSON Formatter
- Paste your JSON into the input field.
- Pick an action: format to make it readable, minify to shrink it, or validate to just check correctness.
- When formatting, set the indentation in number of spaces.
- If there is a syntax error, the parser’s own message appears, pointing at the position of the problem.
Format parses the JSON and rewrites it with line breaks and indentation. This is what turns an API response into something readable.
Minify strips every unnecessary whitespace character, leaving the smallest possible text. That is the production format, where every byte transmitted counts.
Validate only checks whether the text is syntactically correct JSON, changing nothing. Useful when you just want to know where the error is.
All three actions run a real parse — this is not character substitution. Invalid JSON is never silently reformatted.
- A trailing comma before } or ] — allowed in JavaScript, forbidden in JSON.
- Single quotes instead of double: JSON requires double quotes, including around key names.
- Comments with // or /* */ — not part of the JSON specification.
- JavaScript-only values such as undefined, NaN and Infinity, which do not exist in JSON.
- Curly quotes pasted from a word processor in place of straight ones.
All processing happens in your browser. Pasted JSON is never sent to a server or logged, which makes the tool suitable for inspecting API responses containing real data.
Key order is preserved as the parser reads it. Duplicate keys within the same object, however, collapse: the last one wins, which is the defined behaviour for JSON.
Very large numbers lose precision, because JSON does not distinguish integers from decimals and JavaScript uses double-precision floating point. If you work with long identifiers, transmit them as strings.
Frequently asked questions
Processing is local and depends on your browser’s memory. Files of a few megabytes work fine; much larger documents may make the interface sluggish while formatting.
Because comments are not part of the JSON specification. Formats such as JSONC and JSON5 accept them, but they are not standard JSON and are not parsed here.
It changes presentation, not values. The two exceptions are duplicate keys, where the last wins, and numbers exceeding floating point precision.
It depends how much indentation there was. On JSON formatted with two spaces, the reduction usually lands between 15% and 30% of the text size.
The content never leaves your browser and nothing is stored. Even so, avoid pasting live credentials into any tool you do not control.