How to use the json formatter
- Paste your JSON into the top box.
- Choose Format to make it readable or Minify to make it compact.
- If the JSON is invalid, the message tells you the line and column of the problem.
- Copy or download the result.
Common JSON errors and how to fix them
| Problem | Wrong | Right |
|---|---|---|
| Trailing comma | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 'b'} | {"a": "b"} |
| Unquoted key | {a: 1} | {"a": 1} |
| Comment | {"a": 1} // note | Comments are not allowed |
| Python-style values | True, None | true, null |
| Missing comma | {"a": 1 "b": 2} | {"a": 1, "b": 2} |
Format vs minify
Formatting adds line breaks and indentation so the structure is visible. Use it when reading or debugging an API response or config file. Minifying removes all optional whitespace to make the data as small as possible for sending over a network. Both contain exactly the same data.
Sort keys A to Z reorders the properties of every object alphabetically. It makes two JSON documents much easier to compare in a diff tool.
Private by design
API responses and config files often contain keys, tokens and personal data. This formatter runs entirely in your browser, and nothing you paste is sent to a server.