Skip to content

Developer Tool

JSON Formatter & Validator

Pretty-print, minify and check JSON, with the position of any syntax error.

Runs in your browser — nothing is uploaded

What this does

JSON is the text format most web APIs send and receive, and most JSON problems are small: a trailing comma, a single quote where a double quote belongs, or a missing bracket at the end of a long payload. This tool parses what you paste with your browser's own JSON parser — the same one JavaScript code uses — and either lays it out readably or tells you where parsing stopped.

Nothing you paste leaves this page. There is no server behind this tool; the parsing happens in your browser tab.

How to use it

  1. Paste JSON into the input box.
  2. Choose an indent size, then press Format to lay it out, or Minify to strip every unnecessary space.
  3. If the JSON is invalid, read the error under the box. When your browser reports a character position, the tool converts it into a line and column so you can find it.
  4. Copy the result with the Copy button.

Where it stops being right

  • It follows strict JSON: comments, trailing commas and single-quoted strings are errors, because standard JSON parsers reject them too.
  • Whole numbers larger than 9,007,199,254,740,991 lose precision when parsed in JavaScript, so formatted output can differ from the input for those values.
  • If an object repeats a key, only the last value survives formatting.

Questions

Why does JSON with a trailing comma fail here?
Because a trailing comma is not valid JSON. JavaScript object literals allow one, which is why it catches people out, but the JSON format itself does not, and a strict parser rejects it.
Is my JSON sent to a server?
No. The tool runs entirely in your browser and makes no network request with your data.
What is the difference between formatting and minifying?
Formatting adds line breaks and indentation so a person can read the structure. Minifying removes all optional whitespace so the text is as small as possible. Both describe exactly the same data.

More developer tools

All developer tools →