What formatting does — and does not do
Formatting changes whitespace only. Key order, numeric precision, string escapes and duplicate keys are preserved exactly as the parser sees them. If two keys share a name, JSON.parse keeps the last one; the formatter will show that result, not the duplicate.
Beautifying is safe for data you intend to re-serialize. It is not a validator for business rules, and it cannot detect trailing commas or comments because those are not JSON.
- 2 spaces — the default in most style guides and the most compact readable form.
- 4 spaces — common in Java and some Python ecosystems.
- Tabs — preferred when the surrounding file already uses tabs.
- Minified output — removes all optional whitespace for payload size.
Error positions that actually help
JSON.parse reports a character position in V8, but the message is often just Unexpected token. The formatter maps the position back to a line and column and shows the surrounding text, so a missing comma on line 42 is identifiable without counting characters.
{
"name": "devtoolbox",
"features": ["json", "cron", "uuid"]
"missing_comma": true
}
The snippet above is invalid on purpose: the array line needs a trailing comma before the next key. The formatter will point at that line.
Large documents
Formatting happens locally, so file size is limited by browser memory rather than upload limits. For multi-megabyte documents, formatting can take a moment; a minified 10 MB file expands to 30–50 MB of text, which is near the point where editors become sluggish.
If you only need to inspect a path, use the JSONPath tester instead of loading the entire formatted document.
A note on duplicate keys and big numbers
JavaScript numbers are IEEE-754 doubles, so integers larger than 2^53 lose precision when parsed. A 64-bit ID such as 9007199254740993 becomes 9007199254740992. If you are formatting data with large IDs, check the digits before trusting the output.