JSON Formatter and Validator
Paste JSON to pretty-print it, minify it or sort its keys. If it is not valid, you get the line and column of the problem in plain words.
Processed in your browser. Nothing you paste is sent to a server.
How to use this tool
- Paste JSON or open a .json file.
- Choose format or minify, the indent and whether to sort keys.
- Copy or download the result. Errors show the line and column.
How it works
The input is parsed with the browser's standard JSON parser (RFC 8259 rules: double-quoted keys and strings, no trailing commas, no comments). Valid JSON is serialised again with your indent. Sorting reorders object keys alphabetically at every level; arrays keep their order.
Limitations
- Numbers larger than 9,007,199,254,740,991 lose precision when JavaScript reads them; the tool warns you when it sees long integers.
- If an object has the same key twice, only the last value is kept, as in every standard JSON parser.
- Comments and trailing commas (JSON5) are reported as errors.
Privacy and data
Everything happens in your browser. What you paste or open is never sent to our server, logged or stored, and the page works offline once loaded.
Frequently asked questions
Why is my JSON invalid?
The most common causes are single quotes instead of double quotes, a trailing comma after the last item, unquoted keys, and comments. The error message points at the first problem the parser met.
Is my data uploaded?
No. Formatting and validation run in your browser.