What this JSON formatter does

Paste JSON and the tool pretty-prints it with indentation and syntax highlighting, minifies it to the smallest valid form, or validates it and points at the first problem. It also reverses the common escapes you run into when copying data around: JSON string escapes, HTML entities, URL encoding and \uXXXX sequences, via the Smart Unescape button.

Everything runs in your browser, so API responses, config files and tokens are never uploaded.

Format, minify, validate

The three buttons answer different questions, and it helps to know which one you want:

  • Format (pretty-print) adds newlines and indentation so a human can read the structure. Use it for debugging and for reviewing API responses.
  • Minify removes every unnecessary space and newline, producing the smallest valid text. Use it before embedding JSON in a query string, a config value or a payload you pay to transfer.
  • Validate only checks syntax and reports the first error with its position. It does not change your data.

Frequently asked questions

What makes JSON invalid?

The usual suspects are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, comments, and an unescaped control character inside a string. JSON is stricter than the JavaScript that many people write by hand. If you already have broken JSON, the JSON Fixer can repair most of these automatically.

Does it support JSON5, JSONC or NDJSON?

Strict JSON only. Comments, trailing commas and single quotes are valid in JSON5 and JSONC but not in JSON, so a validator will reject them. The JSON Fixer can strip those extras if you need to convert them to standard JSON.

Is my JSON uploaded anywhere?

No. Parsing, formatting and validation all happen in your browser with the built-in JSON parser. Nothing is sent over the network, which you can confirm in the DevTools Network tab.

What is the difference between formatting and minifying?

Formatting adds whitespace to make the structure readable; minifying removes all optional whitespace to make the text as small as possible. The data is identical in both cases.

Related tools