How to format (pretty-print) JSON
Short answer
Paste the JSON into a formatter and it re-indents the structure with consistent spacing so it is readable. Formatting also reveals syntax errors, since invalid JSON cannot be parsed and re-printed.
What formatting does
Pretty-printing parses JSON and re-serializes it with newlines and indentation, so nested objects and arrays line up. It does not change the data — only the whitespace. Minifying is the reverse: it removes that whitespace to shrink the payload. See what is JSON.
{"id":1,"tags":["a","b"],"ok":true}
{
"id": 1,
"tags": ["a", "b"],
"ok": true
}Format your JSON
- Paste the JSONDrop minified or messy JSON into the formatter.
- Read the formatted outputIndentation makes the structure and nesting obvious.
- Fix any errorIf it will not format, an error points to the invalid spot — often a trailing comma or unquoted key.
- Copy or minifyCopy the clean version, or minify it again for production.
Common JSON syntax errors
- Trailing commas after the last item — not allowed in JSON
- Single quotes instead of double quotes around strings and keys
- Unquoted object keys (
id:instead of"id":) - Comments — standard JSON does not allow them