How to format JSON
- Paste your JSON into the input box, or click Sample to try it.
- Choose 2 spaces, 4 spaces or tabs, and optionally sort keys alphabetically.
- Click Format for readable output, Minify for compact output, or Validate to check syntax only.
- Copy the result or download it as
data.json.
Clear error messages
When JSON is invalid, browsers often give vague messages. This JSON validator pinpoints the problem: it shows the line and column, explains what went wrong, and displays the line with a caret under the exact spot. It recognises the most common mistakes, including trailing commas before } or ], single quotes instead of double quotes, unquoted property names, missing colons and commas, unclosed strings and braces, and raw line breaks inside strings.
When formatting succeeds, the status line reports the number of keys, the nesting depth and the output size. Sorting keys produces consistent output that is easier to compare with the Text Diff Checker. Everything runs in your browser, so API responses, configuration files and tokens never leave your device.
Common uses
- Making API responses readable while debugging.
- Validating configuration files before deploying.
- Minifying JSON to reduce payload size.
- Sorting keys to compare two JSON documents.
JSON formatter FAQ
Does it support comments or trailing commas?
No. Standard JSON doesn’t allow them, and the validator reports them as errors so your JSON works everywhere.
Is my data uploaded?
No. Parsing and formatting happen locally in your browser.
Are large numbers kept exactly?
Numbers larger than about 9 quadrillion can lose precision in JavaScript. Store very large IDs as strings.