Skip to content
Free online tool

JSON formatter and validator

Paste JSON to format it with clean indentation, validate its syntax or minify it to a single line. Errors are explained in plain English with the exact line and column, so broken JSON is quick to fix.

How to format JSON

  1. Paste your JSON into the input box, or click Sample to try it.
  2. Choose 2 spaces, 4 spaces or tabs, and optionally sort keys alphabetically.
  3. Click Format for readable output, Minify for compact output, or Validate to check syntax only.
  4. 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

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.

Need another tool?

Browse all 50 free tools for PDFs, images, text, SEO, calculations and development.

Explore All Tools