JSON Formatter
v1Paste JSON, get it readable, compact, or checked.
Free · No uploads · On-devicePaste JSON above, then pick Format, Minify or Validate only.
Your JSON stays on this page. Sent anywhere: 0.
How it works
Parse, then print
Format parses the input and prints it with 2-space indent. Minify parses it and prints it on one line with no extra spaces. Validate only parses it and reports valid or invalid without changing anything.
When parsing fails, the error message names the line and column where it stopped, so you can find the problem instead of guessing. Duplicate keys keep the last value, which is how JSON parsing works everywhere. Numbers are handled as JavaScript numbers, so integers above 2 to the power of 53 can lose precision.
Guide
Fixing the usual breakage
- Trailing comma: a comma after the last item in an object or array. JSON forbids it. Delete it.
- Single quotes: JSON strings need double quotes. Single-quoted strings are JavaScript, not JSON.
- Unquoted keys: keys need double quotes too. {name:"Ada"} is invalid; {"name":"Ada"} is valid.
- Comments: JSON has no comments. A // note inside the document breaks parsing.
- Reading API output: paste a cramped one-line response and press Format. The structure becomes visible at once.
Questions
Is my JSON sent anywhere?
No. Formatting, minifying and validation all run in your browser, on your device. Nothing is uploaded, saved or sent anywhere.
Why does it say invalid when the JSON looks fine?
The usual causes are trailing commas, single quotes instead of double quotes, unquoted keys, and comments. JSON allows none of those, even though JavaScript objects do. The error message names the line and column where parsing stopped.
Does formatting change my data?
Only the layout changes. Values stay the same. Key order is kept, except integer-like keys, which JavaScript orders numerically. One exception: integers above 2 to the power of 53 can lose precision, because they are handled as JavaScript numbers.
Does it handle large files?
There is no size limit imposed here, but pasting tens of megabytes can get slow, since the whole document is parsed and re-printed in the page.