JSON formatter and validator
Paste JSON, choose how deep the indentation should be, and press Format. If the text will not parse you get the parser's own message with the line and column it failed on, instead of a red cross and no explanation.
Result
The JSON you paste is parsed inside this tab and never sent anywhere — no upload, no storage, no logging.
How the formatter works
The tool hands your text to the browser's own JSON.parse, then prints the resulting value back out with JSON.stringify and the indentation you picked. That round trip is what makes it a validator as well as a formatter: if the text comes back at all, it is JSON that any other strict parser will accept. Nothing is repaired or guessed at — a file with a trailing comma is reported as broken rather than quietly fixed.
Because the output is regenerated from the parsed value rather than patched in place, formatting normalises a few things beyond whitespace. Escape sequences are decoded and re-emitted in their shortest legal form, so \u00e9 comes back as é. Numbers are re-printed by the JavaScript number formatter, so 1.50 becomes 1.5 and 1e3 becomes 1000. Key order is left exactly as you wrote it; nothing is sorted, and no keys are added.
Minify runs the same parse and prints with no whitespace at all. The status line reports input and output size in UTF-8 bytes, which is what actually travels over a network — not the character count your editor shows, which undercounts accented letters and emoji.
When the parser refuses the text, its message is shown word for word along with a position worked out here. Chrome, Edge and Node report a byte offset for some failures — at position 12 — and the tool counts newlines up to that offset to turn it into a line and column you can jump to. Firefox reports a line and column directly. For a third group of errors the engine gives neither, only the offending token and a fragment of your text, and then you get the message without a position rather than an invented one.
Questions people ask
Why did my large number change when I formatted it?
Because the value passes through a JavaScript number on the way. JSON has no integer type — everything numeric becomes a double, which holds roughly 15 to 17 significant digits. An identifier such as 12345678901234567890 comes back as 12345678901234567000, and those last digits are gone for good. The same round trip drops insignificant zeros and normalises exponents. If your file contains IDs longer than 15 digits, use the formatter to read it, but do not paste the output back into anything that depends on those digits — keep the original, or ask whoever produces the file to send long identifiers as strings.
Why does the error message not always show a line and column?
The wording comes from the browser's own parser, and engines are inconsistent about what they include. Chrome and Node report an offset for some failures, such as a missing quoted property name, and the tool converts that offset into a line and column by counting newlines. For others — a stray bracket, or a trailing comma inside an array — the same engine returns only the token and a snippet of your text, with no offset to convert. Firefox always reports a line and column, and those are passed through unchanged. Rather than guess a position, the tool shows what it was given.
Does formatting change anything besides whitespace?
Three things, all of them consequences of parsing rather than editing text. Duplicate keys collapse: {"a":1,"a":3} becomes {"a":3}, because the parser keeps the last one and the first has already vanished before the formatter sees the value. Escape sequences are decoded, so a six-character \u00e9 is printed as the single character é. Numbers are re-printed as described above. Key order, array order, and the content of strings are untouched.
Why is my JSON rejected when it looks fine?
Almost always one of four habits borrowed from JavaScript that JSON does not allow: a trailing comma before a closing brace or bracket, single-quoted strings, unquoted keys, or comments. NaN, Infinity and undefined are JavaScript values with no JSON equivalent, so anything that emitted them produced text no strict parser will read. If you are editing a config file that does permit comments — a tsconfig or a VS Code settings file — that dialect is JSONC, and it will fail here by design.
Is the JSON I paste sent anywhere?
No. The page loads one small script and calls the parser in your tab; there is no request, no upload, and nothing written to storage. You can confirm it by opening the Network panel before pressing Format, or by disconnecting from the internet — the page keeps working. That matters more here than for most tools, because the JSON people need to reformat is so often a live API response with tokens, addresses or customer records in it.