JSON Formatter
Pretty-print, check, or minify JSON, with error messages that point to the problem.
Runs in your browser — nothing is sent or saved.
How to format JSON
- Paste your JSON in the left box.
- Press Format to lay it out with clean indentation, or Minify to strip spaces.
- If the JSON has a mistake, a message points to the spot.
- Press Copy result.
Format, validate, and minify
Format takes messy or one-line JSON and lays it out with proper indenting, so the structure is easy to read. You can pick two spaces, four spaces, or a tab. Minify does the opposite: it removes every space and line break to make the smallest possible version, which is what you send over a network. Both steps first check that the JSON is valid, so the tool doubles as a validator.
The rules JSON follows
JSON is strict. Keys and text must use double quotes, not single ones. You cannot leave a comma after the last item in a list or object. Comments are not allowed. These are the mistakes that trip people up most, and they are exactly what the error message helps you find.
Reading the error message
When the JSON is broken, the tool shows the reason and roughly where it happened. A message about an unexpected token usually means a missing quote, an extra comma, or a value that is not wrapped correctly. Fix that one spot and format again.
FAQ
Can JSON have comments?
No. The JSON format does not allow comments. If you need notes, put them in a normal field, or use YAML instead, which does allow comments.
Why is my trailing comma an error?
JSON does not allow a comma after the last item in a list or object. Remove it and try again.
What is the difference between format and minify?
Format adds spacing so people can read it. Minify removes spacing so machines can send it in fewer bytes. The data is the same either way.
Does it change my numbers or key order?
Key order is kept as written. Numbers are parsed and printed back, so a value like 1.0 may
show as 1, which is the same number in JSON.
Is my data sent anywhere?
No. It is checked and formatted in your browser and nothing is saved.
Is this also a JSON validator?
Yes. If the JSON has a mistake, you get an error message that points at the spot. When the input is valid, the JSON beautifier pretty prints it with clean indenting, or strips it down to one minified line.