JSON Formatter & Validator
Paste JSON to reformat it, minify it, or find out exactly where it breaks. Invalid input gets the line, the column and the text of the offending line, not just a message.
Same thing, as an API
curl -X POST 'https://akifakkaya.com/api/v1/tools/json/format' \
-H 'Content-Type: application/json' \
-d '{"text":"{\"id\":42,\"name\":\"Ada Lovelace\",\"active\":true,\"roles\":[\"admin\",\"author\"],\"profile\":{\"city\":\"London\",\"joined\":\"1843-08-01\"},\"score\":9.75}","indent":2,"sort_keys":false}'Free, no key, 120 requests a minute. Full endpoint reference
Output
Fix the errors above to see the formatted output.
About this tool
A JSON parser tells you a document is broken and stops. The useful part is where: an unquoted key on line 40 and a trailing comma on line 41 read the same in an error message, and different in the file. This one reports the line, the column and the line's own text, so the fix is a glance rather than a hunt.
The size comparison is there for a practical reason. Minified JSON is what you ship over the wire, and seeing how much whitespace costs on a real payload is usually more persuasive than any rule about it. Formatting only rewrites whitespace and key order — the values are untouched, and the minified output parses to exactly the same document.
Nothing is stored. The document goes to the endpoint, gets parsed, and comes back; there is no database behind this page and no log of what you pasted.
Questions
- Is my JSON stored or logged?
- No. The endpoint parses the text and returns the result. It writes nothing to disk and keeps no copy, which is also why it can be free and keyless.
- Why does it reject a trailing comma?
- Because JSON does. A trailing comma is valid JavaScript and valid JSON5, and it is the single most common reason a config file fails to load. The error points at it.
- Can it handle a large file?
- Up to a megabyte. Past that, formatting in your editor is faster than a round trip, and the tool says so rather than timing out.