JSON formatter and validator
Paste JSON to pretty-print it with the indentation you prefer, or minify it for production. Invalid input shows the exact parser error, and nothing you paste leaves your browser.
Text is processed by your own browser and never leaves your device: this page has no server to send it to.
How it works
The input is parsed with the browser's native JSON parser, so validation matches exactly what JavaScript accepts: no comments, no trailing commas, double quotes only. Valid input is re-serialized with your chosen indentation; the minified mode strips all whitespace.
Frequently asked questions
Why is my JSON reported as invalid?
The usual suspects are trailing commas, single quotes instead of double quotes, comments, or unquoted keys. Strict JSON allows none of those; the error message points at the offending position.
Does formatting change my data?
No. Only whitespace changes. Key order, values and escaping are preserved exactly as the parser read them.
Can I minify JSON here too?
Yes. Pick the minified mode and the output collapses to a single line with no spaces, which is what you want for config payloads and HTTP bodies.