JSON Formatter & Beautifier

Quickly format and pretty-print JSON with custom indentation

Pretty-print JSON with your choice of indentation, optionally sort keys alphabetically or escape non-ASCII characters - with precise error locations for invalid JSON.
Try an example:

Output will appear here...

About JSON Formatter & Beautifier

How it works

  1. The text is parsed as strict JSON.
  2. It is written back out with one key per line and your chosen indentation; keys can be sorted at every level.
  3. If the JSON is invalid, the error shows the line, column and surrounding text with a hint.

What you need

  • Valid JSON text (use JSON Validator to find problems first).

Tips

  • Escaping non-ASCII produces pure-ASCII output, useful for systems that mishandle UTF-8.

Runs in your browser. Everything happens in your browser - your code and data are never uploaded.

Frequently asked questions

What makes JSON invalid?+

The most common causes are trailing commas, single quotes instead of double quotes, unquoted keys, comments, and values like undefined or NaN. The error shows the exact line and column, and a hint names the likely cause.

Is my JSON sent anywhere?+

No. Parsing and formatting happen in your browser with the built-in JSON engine.