JSON Formatter & Validator
Paste messy JSON and get it back readable. When it will not parse, you get the line, the column and an explanation of what is actually wrong - not just "Unexpected token".
Output appears here as you type.
Runs entirely in your browser. Nothing you paste here is uploaded or stored.
Questions
Is my JSON uploaded anywhere?
No. The conversion runs in your browser as a pure JavaScript function. There is no upload, no account, and no server-side processing, so you can safely paste production API responses.
Why does my JSON say "Unexpected token }"?
Almost always a trailing comma before the closing bracket. JSON, unlike JavaScript and unlike most linters people are used to, does not allow one. This formatter detects that case and says so directly.
Can it sort object keys?
Yes. Turn on "Sort keys" to alphabetise every object recursively, which makes two responses far easier to compare by eye.