JSON Formatter
Beautify and validate JSON with clean indentation.
How to use the JSON Formatter
- Paste your JSON.
- It is validated and pretty-printed instantly.
- Copy the formatted result.
About the JSON Formatter
JSON was specified by Douglas Crockford and is now standardised by both ECMA and the IETF. It borrows JavaScript’s object syntax but is far stricter, and that strictness is where most people get burned. Paste a payload here and it is parsed and re-printed with your choice of two spaces, four spaces or a tab — and when it will not parse, you get the parser’s own error message instead of a blank screen.
The usual culprits are worth knowing. JSON has no comments — a deliberate decision by Crockford — and no trailing commas, which is far and away the most common parse error. Keys must be wrapped in double quotes, so a JavaScript object literal with bare keys or single quotes is not valid JSON. There is no date type either, so dates travel as strings by convention.
One thing to watch: JSON numbers are parsed as IEEE-754 doubles, so an integer beyond 9,007,199,254,740,991 loses precision on the way through — large IDs are safer carried as strings. Because this tool genuinely parses and re-serialises rather than nudging whitespace, duplicate keys silently collapse to the last one. Everything runs in your browser, so an API response full of real customer data never leaves your machine. When you are ready to ship it, the JSON minifier strips it back down.
Frequently asked questions
Why does my JSON fail when it has comments in it?
Because JSON has no comment syntax at all — it was left out on purpose. Anything like // or /* */ is a syntax error, no matter how many tools tolerate it. Strip the comments, or use a format such as JSON5 or YAML if you need them.
What causes "Unexpected token" errors most often?
A trailing comma after the last item in an object or array. JavaScript allows it, JSON does not. The next most common causes are single-quoted strings and unquoted keys — both valid JavaScript, neither valid JSON.
Does formatting change my data?
The values stay the same, but the text is regenerated rather than merely re-indented. So number literals are printed canonically (1.50 becomes 1.5), and if an object contains the same key twice, only the last one survives — which is standard parser behaviour, not a bug in this tool.
Why does my large ID come back as a different number?
JSON numbers are parsed as double-precision floats, which are exact only up to about 9 quadrillion. A 64-bit ID above that gets rounded to the nearest representable value. Quote such IDs as strings in your API to avoid it.
Is my JSON uploaded anywhere?
No. Parsing and formatting both happen in your browser, so you can safely paste a production response or a token payload — nothing is sent to a server.

