JSON Formatter and Validator
Format, minify or validate JSON and see exactly where an error is.
Start the toolDescription
Format JSON with clear indentation, minify it without extra whitespace, or validate it. When there is an error it shows the position (line and column) where possible, and can sort keys alphabetically.
How to use it
- Choose the operation: format, minify or validate.
- Paste your JSON into the input box.
- Press “Run”.
- Copy or download the result, or press “Reverse operation” to switch between formatting and minifying.
How it works
The text is parsed with the browser’s standard JSON parser. If parsing succeeds, the text is regenerated with or without indentation. Note that integers larger than 2^53 may lose precision because JavaScript represents numbers as floating point.
Frequently asked questions
Can it show where my JSON is invalid?
Yes. When parsing fails, the tool reports the line and column of the error where your browser provides it, so you can jump to the exact spot.
Does formatting change my data?
No, only whitespace changes. Integers larger than 2^53 can lose precision in any JavaScript tool, and this tool warns you when that happens.
Can I minify JSON?
Yes. The tool minifies by removing all unnecessary whitespace, which is useful for reducing payload size before embedding or transmitting JSON.
Can I sort keys alphabetically?
Yes. There is an option to sort object keys alphabetically, which makes diffs and manual review easier.
Does it support JSON5 or comments?
The tool targets strict JSON, which is what most APIs and configs expect. JSON5 and comments are not supported, so what you see is what other tools will accept.