JSON Formatter & Validator
Format, minify and validate JSON — with the line and column of any error.
About the JSON Formatter
Paste JSON to reformat it at your chosen indent, minify it to a single line, or sort its keys for comparison. Invalid input reports the line and column where parsing stopped, together with the offending line — which is the part a bare JSON.parse error does badly. The shape summary counts objects, arrays and values and measures nesting depth, so an unfamiliar payload can be understood at a glance. Everything runs in your browser: no request is made, which is what makes pasting a real API response reasonable.
Is my JSON uploaded anywhere?
No. The parser is the browser's own JSON engine, running in your tab. Nothing is sent to a server, which is why pasting an API response containing real data is safe here.
Why does it sometimes not show a line number?
The browser reports some syntax errors without saying which character it stopped at — for example a stray comma, when the document contains several valid commas. In that case any line number would be a guess, and a confident wrong line sends you to code that is fine. The tool says the position is unknown instead.
What does sorting keys change?
It reorders object keys alphabetically, recursively, which makes two payloads comparable by eye or by diff. Arrays keep their original order because position carries meaning in an array.
Can it handle a large file?
Yes, within the memory your browser allows. Formatting a very large document is fast, but a deeply nested one is counted iteratively rather than recursively so it cannot overflow the stack.
Does it support JSON5 or comments?
No. It validates strict JSON, which is what an API will accept. A trailing comma or an unquoted key is reported as the error it would be in production.
Related: Base64 Encoder · JWT Decoder · Code Formatter
Keywords: json formatter, json validator, json beautifier, json minify, format json online, json lint, no upload