How to Format and Validate JSON (and Fix Common Errors)
Updated October 2026
JSON that arrives as one long line is almost impossible to read, and one missing quote makes a whole file fail. A JSON formatter turns the long line into a clear, indented structure and tells you where the problem is when something is wrong. It can be done on your own device, so private data is not sent anywhere.
Format JSON in three steps
- Open the JSON Formatter.
- Paste your JSON into the input box.
- Choose Format, Minify or Validate, and copy the result.
Formatting only changes whitespace. The keys stay in the same order and the values are not touched.
Format, minify or validate?
| Choose | When you want to | Result |
|---|---|---|
| Format | Read or edit the JSON | Indented, one item per line (2 spaces, 4 spaces or tabs) |
| Minify | Send or store the JSON in the smallest form | Everything on a single line |
| Validate | Check whether the JSON is correct | A yes, or an error message that points to where parsing failed |
The most common JSON errors
Standard JSON is strict. These are the mistakes that cause most error messages:
| Mistake | Wrong | Right |
|---|---|---|
| Trailing comma | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 1} | {"a": 1} |
| Key without quotes | {a: 1} | {"a": 1} |
| Comment in the file | {"a": 1} // note | Remove the comment |
If the error message points to a place that looks fine, look at the line just before it. A missing comma or a missing closing bracket is usually reported where the parser gets confused, not where the mistake was made.
Is it safe to paste private data?
The JSON is parsed in your browser and is not sent to a server. That makes it a reasonable choice for payloads that contain names, tokens or other internal data. As a general habit, still remove real secrets such as passwords and API keys before you paste anything anywhere.
Related helpers
JSON often contains encoded text. If you find a long string of letters and numbers that ends in one or two equals signs, it may be Base64.