How to Format JSON
Formatting JSON means parsing it, then reprinting the same value with consistent indentation. Invalid text cannot be formatted — fix the syntax first.
What “format” does
A formatter parses the text as JSON, then writes the same value back with line breaks and indentation. That is why a beautifier and a formatter are the same job. If parse fails, there is nothing safe to indent.
{"name":"Ada","ok":true}becomes:
{
"name": "Ada",
"ok": true
}Steps
- Paste the JSON. Do not wrap it in extra quotes unless those quotes are part of the document.
- Run Format (or Pretty-print). On MultiConvers you can pick 2- or 4-space indent.
- If you get a parse error, switch to validation and fix the line it points at.
The MultiConvers JSON formatter does this in the browser. The text is not uploaded.
What will not format
- Trailing commas:
{"a": 1,} - Comments:
{"a": 1 /* no */} - Single quotes:
{'a': 1}
Those belong to JSON5 or JavaScript, not JSON. Pretty-print is the same reprint step with a readability focus.
FAQ
- Why did formatting fail on a trailing comma?
JSON does not allow a comma after the last property or array item. Remove it, then format again.
- Will formatting change my data?
It should not change the value. Key order is preserved by typical engines. Whitespace and insignificant number spelling may be normalized.
Related guides
How to Validate JSON
Valid JSON is text that JSON.parse accepts. Validation does not pretty-print or minify; it only reports whether the document is legal JSON.
JSON Pretty Print
Pretty-print reprints valid JSON with indentation so a person can read it. Minify reprints the same value as one line. Neither changes what the document means.
Related tools
See all guides.