JSON Formatter
Beautify, minify and validate JSON with the exact error line and column. Your data stays in your browser.
Your JSON is processed in your browser; it is never sent or stored.
What it does
API responses and log lines usually arrive as one long line of JSON. The tool indents it so it is readable, minifies it back, and if it is invalid, shows exactly where with the line and column. Sorting keys alphabetically makes two JSON documents easy to compare.
Common JSON errors
Trailing comma: a comma after the last item is fine in JavaScript, not in JSON. Single quotes: strings and keys need double quotes. Comments: JSON has no // or /* */; a comment in package.json or composer.json breaks every tool that reads it. Line breaks in strings: you cannot press Enter inside quotes; write \n.
JSON on the server
On the command line jq or Python does the same job; if jq is missing, apt install jq is all it takes:
curl -s https://api.example.com/v1/status | jq .
python3 -m json.tool config.json
jq -S . config.json > sorted.json
The tool keeps numbers exactly as written: JavaScript's JSON.parse silently rounds large IDs such as 9007199254740993, this tool does not. It also warns when a key appears twice in one object; most parsers keep only the last one. To decode base64 fields, use our base64 decoder.
More free tools
FAQ
About JSON Formatter
No. Parsing and formatting run in your browser; nothing is sent or stored. You can paste responses that contain API keys or personal data, though you should still remove secrets before sharing the output.
Files of a few megabytes are processed in well under a second, and the work runs in the background so the page stays responsive. For very large files (hundreds of MB), jq on the command line is a better fit.
JSON is stricter: keys and strings need double quotes, and trailing commas, comments, undefined, NaN and functions are not allowed. That is why an object copied from the browser console is often not valid JSON.