JSON formatter / validator / minifier
Paste JSON to pretty-print it or squash it into a single line. When the syntax breaks, you get the exact line and column.
How to use
- Paste JSON into the left box, or press Sample first to see what it does.
- Format pretty-prints, Minify removes all whitespace, Validate only checks syntax without touching the content.
- The result appears on the right — take it with Copy result.
Locating a syntax error
A raw JSON.parse error gives you a character offset, which is close to useless in a large document. This tool converts it into a line and column, plus a snippet of the surrounding text:
Line 4, column 12: Unexpected token }
It also recognises the usual mistakes — trailing commas, single quotes, comments — and says so directly instead of a generic "parse failed".
JSON rules people trip over
- Keys need double quotes. Single quotes are a JavaScript object literal, not JSON.
- No trailing comma after the last element. Legal in JS, a syntax error in JSON.
- No comments. Use a
"_comment"field, or a superset such as JSON5 or JSONC. - No leading zeros in numbers —
01is invalid,1is fine.
FAQ
Does a large document freeze the page?
A few megabytes finishes in a second or two. Past 10MB the single-threaded parser will pause briefly — split the payload server-side first.
Is my data uploaded?
No. Parsing and formatting happen in JavaScript on this device; nothing is sent anywhere.
Can it convert JSON to another format?
This version focuses on formatting and validation. For YAML or CSV conversion, ask via the contact page.