Beautify, minify and validate JSON
This tool is for anyone holding a JSON blob that is hard to read or possibly broken: a one-line API response, a clipped log entry, a hand-edited config. It parses the text with the browser's own JSON.parse and, on success, prints it again either as multi-line text indented by 2 spaces or as one compact line. It is a strict validator rather than a forgiving parser. It will not repair anything, and comments, single quotes and trailing commas are all rejected.
Format {"id":12345678901234567890,"price":1.50,"n":1e3} and the three lines you get back show id as 12345678901234567000, price as 1.5 and n as 1000. Numbers are parsed into JavaScript doubles and printed again, not copied as text. For an error case, {"a":1,} gave "Expected double-quoted property name in JSON at position 7 (line 1 column 8)" on a Node 22 engine; the exact wording, and whether a line and column appear, depends on your browser version.
Standard JSON has no comments. Files such as tsconfig.json or VS Code settings are JSONC and often contain them, so strip the comments by hand before pasting.
JSON requires double quotes for strings and keys and forbids a comma after the last item. {'a':1} and [1,2,] are refused because the tool deliberately mirrors JSON.parse.
The structure stays, but numbers may be normalised and key order may shift, as described above. That is fine for readability; to compare against an original byte for byte, use a text diff instead of relying on re-serialised output.
Yes. They differ only in whitespace and parse into identical data, so minify for sending or storing and format for reading.
Parsing and printing happen locally in your browser. Pasted or uploaded content is not sent to a server, and Download builds the file on your device.