What JSON is, and why it fails to parse
JSON is the text format most APIs, config files and log pipelines use to pass data around. It is deliberately strict, and almost every parse error breaks one of four rules:
- Double quotesKeys and strings use
", never', and keys are always quoted —{name: 1}is JavaScript. - No trailing commas
[1, 2,]is invalid. - No commentsNeither
//nor/* */. - Three literals
true,false,null— notTrueorNone.
The other common problem is JSON that is valid but unreadable: squeezed onto one line, or escaped into a string by a logger or a message queue, sometimes twice.
How to use the JSON formatter
- Paste JSON into Input, or load a sample.
- Press Format (or Ctrl / Cmd + Enter). An error shows its line and column and points at the character.
- If the JSON arrived as an escaped string —
"{\"id\":1}"— press Unescape. Tick Expand Nested JSON to open JSON stored inside string values too. - If it is almost JSON — comments, single quotes, trailing commas, Python's
TrueandNone— press Repair. Every change is listed under the output. - Copy or download the result. Minify puts it on one line; Stringify escapes it back into a string literal.
Examples
Read an escaped log line
A logger stored the event as a string, and the payload inside it is a string too.
"{\"event\":\"order.created\",\"payload\":\"{\\\"orderId\\\":42,\\\"total\\\":19.90}\"}"Turn a Python dict into JSON
Printed from Python: single quotes, True and None.
{'user': 'Ada', 'active': True, 'manager': None, 'tags': ['admin']}Find the trailing comma
The error points at the exact comma, then Repair removes it.
{"roles": ["admin", "beta",], "active": true}Keep 64-bit IDs intact
JSON.parse would turn this ID into 12345678901234567000. Here it stays as written.
{"id": 12345678901234567890, "price": 19.90}Frequently asked questions
Is my JSON sent anywhere?
No. Formatting, validation and repair all run in your browser, on your device. To check, open your browser's developer tools, switch to the Network tab and format something — no request appears. The page also works with your network switched off.
Why did my big number change in another tool?
JavaScript stores numbers as 64-bit floats, so integers above 9,007,199,254,740,991 lose precision when parsed with JSON.parse, and 1.0 becomes 1. This formatter never converts numbers: it keeps the digits you pasted.
What is the difference between JSON and JSON5?
JSON5 allows comments, trailing commas, single quotes and unquoted keys. Most APIs accept only strict JSON. Repair converts JSON5-style input into strict JSON and lists what it changed.
What does "duplicate key" mean?
The same key appears twice in one object. The JSON standard says keys should be unique, and most parsers silently keep only the last value — so the first one is lost without an error. The formatter warns and names both lines.
How large a file can I format?
Up to 10 MB. Large input is formatted in the background, so the page stays responsive while it works.