All tools Developer

JSON Formatter

Format, validate and minify JSON.

Paste JSON above and hit Format.

Runs in your browser. Nothing you open or type here is uploaded.

How to use

  1. Paste JSON into the input field.
  2. Choose an indent: 2 spaces, 4 spaces or Tab.
  3. Run Format to pretty-print it, or Minify to strip it down to one line.
  4. Copy the result.

Details

The formatter parses JSON with the browser's strict parser and prints it back with consistent indentation, which makes nested structures readable and diffs easier to scan. Minify does the reverse, removing all optional whitespace. Invalid input is rejected with the parser's error message and its position — line and column — so trailing commas, unquoted keys and other common mistakes can be found without guesswork.

  • An error position points at where parsing failed, which often sits right after the actual mistake; check the character before it first.
  • Minify changes whitespace only; the data is unchanged.

Common 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 payloads.

What does the validator check?

Strict JSON syntax — it will point out trailing commas, unquoted keys, and other common errors with a clear message.