JSON Formatter and Validator
Paste JSON to format or minify it, and see exactly where an error is, by line and column, with the reason.
Result
Paste JSON and the result appears here straight away.
Show the tree
How to use it
- Paste JSON into the box.
- Choose the output style: 2 spaces, 4 spaces, or minified on one line.
- Copy the result or download it as a file. If there is an error, press “Go to the error”.
Examples
- Format{"a":1,"b":[true,null]} one line per value, indented by two spaces
- Numbers stay as written{"id":12345678901234567890,"p":1.10} both numbers unchanged, with a note about the large one
- Trailing comma[1,2,] error on line 1, column 6: an extra comma before the closing bracket
Tool details and privacy
Paste JSON to format it with clear indentation or minify it onto one line. If it has an error, the tool shows the line, the column and the reason, and takes you to it. The tool is free and runs entirely in your browser.
The tool reads the text character by character with its own parser, so it finds the exact position of an error in every browser. It writes numbers back as they were written, so a long number such as 12345678901234567890 does not change and 1.10 keeps its zero.
Options
- Output formatted with 2 or 4 spaces, or minified on one line.
- A collapsible tree that shows how many items each object and array holds.
- Copy the result, or download it as a JSON file.
Limits
- Up to 200,000 characters of text and 500 levels of nesting.
- Standard JSON only: no comments, no single quotes, no trailing comma.
- The tool checks the syntax. It does not check the data against a JSON Schema.
- Repeated keys stay in the result as they are, with a note.
Privacy
The text is processed inside your browser. It is not sent to any server, it is not stored, and no code inside it is run.
Questions
Why is there an error when the JSON looks fine?
The usual causes are a comma after the last item, single quotes instead of double quotes, keys without quotes, and comments. The tool names the cause and where it is.
Do large numbers change when JSON is formatted?
No. Numbers are written back as they appear in the text, and the tool tells you when one is larger than JavaScript can hold exactly.
What is the difference between formatting and minifying?
Formatting adds lines and spaces so a person can read the text. Minifying removes them to make it smaller. The data stays the same.
Is my JSON uploaded to a server?
No. All processing happens in your browser, so you can paste private data.