A response body, a config file, or a line that came back from a log.
2
Choose the shape
Two or four spaces, tabs, sorted keys, or minified onto one line.
3
Copy the result
The key count and the size before and after are shown next to the output.
What the error position means
JSON allows no trailing commas, no comments, no single quotes and no unquoted keys. When the parser stops, the browser's message gives a character position, and this page turns that into a line and column so you can find it. The most common culprits are the comma before a closing brace, a double quote missing inside a string, and a control character that came in with a copy-paste.
The line number counts from the start of what you pasted, not from the file it came from. If you pasted a fragment, expect the line number to be relative to the fragment. Nothing is repaired automatically: a formatter that silently fixes JSON teaches you nothing and can change data.
Formatting choices that matter
Two spaces is the common convention for config files and API examples; tabs are what some editors insert; four spaces makes deeply nested data readable. Sorting keys alphabetically makes two responses diffable and is what this tool does recursively, at every level rather than only the top.
Duplicate keys are legal JSON and every parser keeps the last one, so a formatter that shows both would be lying about what the program sees. Large integers are the other trap: JSON numbers are parsed as doubles, so an ID above 2^53 loses precision. If your data has such IDs, they belong in strings, and this page cannot recover digits that the parse already dropped.
Minify, and what it does not fix
Minifying removes the whitespace between tokens and nothing else. It does not validate against a schema, does not check that a field is present, and does not fix a syntax error — an invalid document is reported as invalid before minification is attempted. The byte counts show the real saving, which for pretty-printed JSON is often 30–50%.
For anything served over HTTP, gzip already removes most of that repetition on the wire, so minifying a response body is rarely worth it. Where it matters is a config embedded in an environment variable, a payload pasted into a chat, or a URL parameter — places where whitespace is dead weight. To convert the same data to YAML instead, use the JSON and YAML converter.
Frequently asked questions
Is my JSON uploaded?No. The text is parsed and re-serialised in this browser tab, and no request is made.Can JSON have comments?No. JSON has no comment syntax; a comment makes the document invalid. JSON5 and JSONC allow them, but they are different formats.Can I use a trailing comma?No. A comma before a closing brace or bracket is a syntax error, and the error message points at it.Why did my large number change?JavaScript numbers are doubles, so integers above 2^53 lose precision. Keep IDs in strings if they are that large.Does sorting keys change the data?No. Object key order has no meaning in JSON; sorting only changes the display, which makes two documents easier to compare.How large a document can it handle?A few megabytes is fine. Beyond that the tab's memory and the redraw become the limit, and a desktop tool is a better choice.