JSON Formatter
Beautify unreadable JSON, minify it back down, and catch syntax errors with a message that actually tells you where the problem is.
How it works
A compact workflow from input to download.
Paste your JSON
Drop in an API response, a config file, or a single unreadable line of minified JSON.
Format or minify
Beautify it with clean indentation, or strip every unnecessary byte for production.
Copy the result
Copy the formatted output, or read the error message if the JSON is not valid.
Frequently asked questions
Why does my JSON fail to validate?
Can JSON contain comments?
What is the difference between formatting and minifying?
Does it handle very large JSON files?
Is my data sent to a server?
Why JSON took over
JSON won because it was radically less than what it replaced. XML, the previous default for data interchange, was powerful, extensible and enormously verbose — a simple record could take five lines of angle brackets and repeat every field name twice, once to open a tag and once to close it. JSON offers four primitive types, two container types, and nothing else: no namespaces, no schemas, no attributes-versus-elements distinction, no processing instructions. It maps directly onto the data structures every modern programming language already has, so parsing it requires no ceremony. It is human-readable without being wordy. That deliberate poverty of features is precisely why it became the default language of web APIs within about a decade.
The strictness that catches everyone
The single most common source of frustration is that JSON looks exactly like a JavaScript object literal and is significantly stricter than one. Keys must be wrapped in double quotes — not single quotes, not bare. Strings must use double quotes too. A trailing comma after the final element, which JavaScript now cheerfully permits and many style guides actively encourage, is a hard syntax error in JSON. Comments are forbidden entirely. Numbers cannot have leading zeros or a trailing decimal point, and NaN and Infinity are not valid values. This is why copying an object out of your source code and pasting it into a JSON field so reliably fails: it is very nearly JSON, and very nearly is not good enough for a parser.
Related tools
Continue the workflow with adjacent tools.