Why a formatter
APIs and log pipelines emit JSON minified — all whitespace stripped — to save bandwidth. That is efficient for machines and unreadable for people. Pretty- printing re-introduces indentation and line breaks so you can actually see the structure, spot the field you need, and diff two payloads. Going the other way, minifying collapses a hand-edited document back down for transport.
Exact error location
When JSON is invalid, the single most useful thing a tool can tell you is where. This formatter reports the line and column of the first error and draws a caret under the offending character, so a misplaced comma in a thousand-line file takes seconds to find instead of minutes.
What strict JSON rejects
JSON is stricter than JavaScript object syntax, and the differences trip people up constantly:
- Trailing commas —
[1, 2, 3,]is valid JavaScript but invalid JSON. - Comments —
//and/* */are not allowed. - Single quotes — keys and strings must use double quotes.
- Unquoted keys —
{a: 1}must be{"a": 1}. - NaN and Infinity — not representable in JSON.
The big-integer caveat
JavaScript numbers are IEEE-754 doubles, which hold only about 15–16 significant decimal digits exactly. A JSON number like a 19-digit Twitter/X snowflake ID or a large database key will be silently rounded by any JavaScript-based formatter — including this one — the moment it is parsed. This tool warns you when the input contains such a number; if you need to preserve it, keep it as a string in the JSON.
Local and private
The document is parsed and formatted entirely in your browser. Nothing is sent to a server, which matters when the JSON contains tokens, personal data, or anything else you would not paste into a random website.
Related tools: the JSON diff compares two documents structurally, the Base64 converter decodes a JWT payload into JSON you can then format here, and the Unix timestamp converter makes sense of the epoch times JSON APIs are full of.