JSON Formatter
Turn a wall of minified JSON into readable, indented text — or squeeze formatted JSON back down for transport. Paste your JSON and choose pretty-print or minify; validation runs automatically either way.
How it works
Paste JSON into the box. Invalid documents get an error with the exact position; valid ones can be pretty-printed with one click. Nothing leaves your browser, however large the payload.
Formula and source
Formatting follows the JSON grammar (ECMA-404: objects, arrays, strings, numbers, true/false/null) and re-serializes with 2-space indentation. Source: json.org (ECMA-404), https://www.json.org — last verified 2026-10-09.
Worked examples
- Minified {"name":"Ava","tags":["x","y"]} ? Pretty-prints to an 8-line indented document
- Text with a trailing comma {"a":1,} ? Rejected with the exact error position
Common mistakes
- Single quotes: JSON strings need double quotes — {'a':1} is invalid.
- Trailing commas after the last item — forbidden in strict JSON.
- Comments (// or /* */) are not part of JSON and will fail validation.
Tips
- Validate first, format second — formatters refuse broken input.
- For huge files, minify before pasting into chats or tickets.
FAQ
How do I format JSON nicely?
Paste it into the tool and hit Pretty-print u2014 you get consistent 2-space indentation.
What is minified JSON?
JSON with all unnecessary whitespace removed, for compact transport or embedding.
Why does my JSON fail to parse?
The usual culprits are single quotes, trailing commas, comments, or unescaped control characters.
Can JSON have comments?
No u2014 the spec has no comments. Strip them before validating.
Is the JSON formatter free?
Yes, completely free with no signup.
Is my JSON uploaded anywhere?
No. Parsing and formatting happen entirely in your browser.