JSON Formatter & Validator
JSON Formatter re-indents a JSON document so it can be read and reviewed, and points out the first syntax error if it is not valid.
How to use it
- Paste your JSON into the input box
- Choose an indentation (2 spaces, 4 spaces, or a tab)
- Click Format to get a readable result, or a clear error if it's invalid
Paste minified or hand-broken JSON, choose 2 spaces, 4 spaces or a tab, and it is parsed by the browser's JSON engine and printed back cleanly. Parsing is strict — comments, trailing commas and single-quoted strings are rejected. Because it round-trips through the engine, duplicate object keys collapse to the last value, keys that look like integers are re-ordered numerically ahead of the rest, and integers past plus or minus 2^53 or very long decimals lose precision. For the opposite goal — the smallest payload — use JSON Minifier, which validates the same way but removes whitespace instead of adding it. Input is limited to 2 MB, about 100,000 values and 64 nesting levels, and nothing is uploaded.
FAQ
The values stay the same, but the structure can: duplicate object keys keep only the last value, and keys that look like integers are re-ordered numerically ahead of other keys.
No. Only strict JSON parses — no // or /* */ comments, no trailing commas, no single quotes. The error message points to the first problem.
When you want the smallest output rather than a readable one. It runs the same validation but removes every non-essential space, tab and line break.