Short answer: paste JSON above and the formatted result appears as you type. If it is invalid you get the line, the column and the reason — not a generic "invalid JSON" message. Use Minified to strip every optional space, and Sort keys to make two files diffable.
What the formatter changes, and what it does not
The browser parses the document with JSON.parse and prints it again. That means numbers, strings and booleans are preserved exactly as written — 1e3 becomes1000 and 1.50 becomes 1.5, because both spell the same value and JSON has one canonical number form. Whitespace and (optionally) key order change. Nothing else does.
Object keys that appear twice collapse to the last value, which is the behaviour every JSON parser has. The tool does not warn about duplicates, because by the time the document is parsed the earlier value is already gone; use a linter if duplicate keys matter to you.
Why validate in the browser
Configuration files, API responses and fixtures routinely contain tokens, internal hostnames and customer data. Uploading them to a formatter means handing that to a third party and hoping they delete it. This page has no upload endpoint: the network panel shows only the static files for the page itself.
The related document tools work the same way — Markdown to HTML,HTML to Markdown andHTML to PDF all run on the device.
Common JSON errors this tool names
- Trailing comma —
{"a": 1,}is not JSON. Remove the comma, or use JSON5 if the file is genuinely JSON5. - Single quotes — JSON strings need double quotes, including keys.
- Comments —
//and/* */are not JSON. - Unquoted keys —
{a: 1}is JavaScript, not JSON. - Unescaped control characters — a raw newline inside a string must be written as
\n.