Was this tool helpful?
How to use the JSON Formatter
- 1Paste your JSON.
- 2Click Format or Minify.
- 3Fix any errors shown, then copy or download the result.
Common JSON errors
Trailing commas after the last item, single quotes instead of double quotes, unquoted property names and comments are not allowed in standard JSON. The validator shows the line and column of the first problem so you can fix it quickly.
JSON vs JavaScript objects
| Rule | JSON | JavaScript |
|---|---|---|
| Key quotes | Double quotes required | Optional |
| Strings | Double quotes only | Single, double or backticks |
| Trailing commas | Not allowed | Allowed |
| Comments | Not allowed | Allowed |
| Values | string, number, boolean, null, object, array | Also undefined, functions, dates… |
Pretty print or minify?
Pretty-printed JSON (2-space indent) is easiest to read and review. Minified JSON removes all whitespace and can be 10–30% smaller, which matters for APIs and config files sent over the network. Both contain exactly the same data.
Frequently asked questions
Is my JSON sent to a server?
No. Parsing and formatting happen locally in your browser, which makes it safe for API keys and private data.
Can it sort keys?
Yes. Turn on 'Sort keys' to order object keys alphabetically, which makes JSON easier to compare.