§ 1.1What the formatter does
It parses your text with the browser’s own JSON.parse — the same strict parser your JavaScript code uses — and prints it back with consistent indentation. If parsing fails, nothing is guessed or repaired: you see the parser’s message and the line and column where it stopped, so you can fix the real problem.
§ 1.2The errors you’ll actually hit
| Symptom | Cause |
|---|---|
Unexpected token } | A trailing comma before } or ]. JSON doesn’t allow it. |
Unexpected token ' | Single quotes. JSON strings and keys need double quotes. |
Unexpected token / | Comments. Standard JSON has none; JSONC and JSON5 do. |
| Unexpected token in property name | An unquoted key, like {id: 1}. |
| Bad control character in string | A raw line break or tab inside a string — escape it as \n or \t. |
§ 1.3Things to know
- Big numbers lose precision. JavaScript numbers are 64-bit floats, so integers above 9,007,199,254,740,991 (253 − 1) are rounded when parsed. If you work with 64-bit IDs, keep them as strings.
- Duplicate keys: the last one wins when parsed, so the formatted output keeps only one.
- Sort keys only reorders object keys; array order is never changed.
§ 1.QQuestions
Is my JSON sent to a server?
No. Parsing and formatting happen in your browser tab; you can disconnect from the internet and it still works.
What is the difference between formatting and validating?
Formatting assumes the JSON is valid and re-prints it. The JSON validator focuses on explaining what is wrong and where.
§ 1.RReferences
- RFC 8259 — The JavaScript Object Notation (JSON) Data Interchange Format
- MDN — Number.MAX_SAFE_INTEGER
Last reviewed 2026-10-14.