JSON Formatter and Validator
Pretty-print, minify, sort keys and validate JSON, with precise error locations.
Runs in your browser — nothing is uploadedFree trial: 1 run of JSON Formatter and Validator every day. After that, 2 credits per run.
Format, minify and check JSON, with the shape reported back
Paste JSON to pretty-print it with two spaces, four spaces or tabs, optionally sorting keys alphabetically. Minify to strip every unnecessary byte. A syntax error is reported rather than guessed at, and you get a count of keys, arrays and objects plus the nesting depth, which is the quickest way to understand an unfamiliar payload.
What JSON Formatter and Validator gives you
Three indent styles
Two spaces, four spaces or tabs, to match whatever convention your project already uses.
Alphabetical key sorting
Sort keys recursively so two versions of the same payload can be compared line by line.
Minify
Strip whitespace for embedding in a config, a request body or an environment variable.
Structure statistics
Key count, array count, object count and maximum depth, so you can size up a payload at a glance.
Parsing only, never evaluation
The text is parsed as JSON and never executed, so pasting an unfamiliar payload is safe.
How to use JSON Formatter and Validator
Paste your JSON
Up to 25 MB.
Choose indent and sorting
Pick the indent style and whether keys should be sorted.
Format or minify
Pretty-print for reading, minify for transport.
Copy the result
Along with the statistics if you need them.
Other names for this tool
People also look for this as JSON beautifier, JSON validator, pretty print JSON, JSON minifier and format JSON online. It is the same tool on this page.
Limitations
- Integers beyond 2^53 are rounded by JSON.parse and are not flagged.
Questions about JSON Formatter and Validator
Is my input ever evaluated as code?
No. Input is parsed with JSON.parse only. Nothing is evaluated as JavaScript.
What about very large numbers?
JavaScript cannot represent integers beyond 2^53 exactly, and JSON.parse rounds them silently. Check such values yourself before relying on the output.
How do I make unreadable JSON legible?
Paste it and format with two spaces, four spaces or tabs. A single-line API response becomes something you can actually read, and the structure statistics tell you the key count and nesting depth at a glance.
Is it safe to paste JSON I do not recognise?
Yes. The text is parsed as JSON and never executed as code, and the JSON is never transmitted — the whole operation happens in your browser. A payload from an unfamiliar source cannot do anything here.
How do I compare two versions of the same payload?
Sort the keys on both sides first, then diff them. Most of the noise in a JSON diff is key ordering rather than real change, and sorting recursively removes it so the actual differences stand out.
Why did my large ID number change?
JavaScript cannot represent integers beyond about 9 quadrillion exactly, so anything past 2^53 is silently rounded when parsed. Check large identifiers carefully — this affects every JSON tool running in a browser, not just this one.
When should I minify rather than format?
When the JSON is going into a config value, a request body or an environment variable, where line breaks cause trouble and bytes matter. Format for reading, minify for transport.
Does this validate against a JSON Schema?
No. It checks that the syntax is valid JSON and reports where it is not. Whether your data matches an expected schema is a separate question this tool does not answer.