Format and validate JSON
Paste a payload and read it properly. Everything is parsed in this tab, which matters when the JSON has a customer record or an API key in it.
Your JSON is parsed in this tab. Nothing is sent to a server.
How to use it#
- Paste your JSON into the first box. It is parsed as you type.
- Choose Format or Minify, set the indent, and tick Sort keys to order them alphabetically.
- Copy the result, or download it as a .json file.
Reading the error message#
When JSON will not parse, the message names the line and column where the parser gave up. That position is where the problem was detected, not always where it was caused. An unclosed brace on line 4 is usually reported at the end of the file.
Three mistakes account for most failures: a trailing comma after the last item, single quotes instead of double quotes, and an unescaped newline inside a string. All three are legal in a JavaScript object literal, which is where the habit comes from, and none of them are legal in JSON.
Why sort keys#
Two API responses that differ in one field are almost impossible to compare by eye when the keys come back in different orders. Sorting both alphabetically turns the comparison into a normal diff.
Key order carries no meaning in JSON, so sorting never changes what the document means to a parser. It is purely for the human reading it.
Pasting real payloads somewhere safe#
Most online JSON formatters post your text to a server to do the work. That is fine for a toy payload. For a production response carrying tokens or customer email addresses it is a data leak you will not see happen, and often a policy breach as well.
This page uses the JSON parser already built into your browser. The text never leaves the tab, which you can verify by opening your network panel, or by going offline and watching it keep working.
Frequently asked questions#
Is my JSON sent to a server?
#
No. Parsing and formatting use your browser’s built-in JSON engine. The page keeps working with your network disconnected, which is the easiest way to confirm it.
Why does my JSON fail to parse?
#
Usually a trailing comma, single quotes instead of double quotes, or an unquoted key. JSON is stricter than a JavaScript object literal: keys must be double-quoted strings and the last item in an object or array must not be followed by a comma.
Does formatting change my data?
#
No. The document is parsed and re-serialised, so whitespace changes and nothing else. Key order changes only if you explicitly sort, which JSON treats as insignificant anyway.
Can it handle large files?
#
Multi-megabyte payloads are fine on a desktop browser. Very large documents (tens of megabytes) can make the text area sluggish, since the constraint is rendering the text, not parsing it.
Does it support JSON5 or comments?
#
No. The parser follows the JSON specification strictly, so comments and trailing commas are reported as errors rather than silently accepted.