JSON Formatter

Format and beautify JSON

Minified JSON from an API response is a single line that is essentially unreadable. Formatting applies consistent indentation and line breaks so you can see the structure, find the field you need, and spot where an unexpected null or empty array is hiding.

How to use it

  1. Paste your JSON into the input panel.
  2. Choose an indent width, commonly 2 or 4 spaces.
  3. Format to beautify, or minify to strip whitespace back out.
  4. Copy the result.

Frequently asked questions

It says syntax error but the JSON looks fine.

The usual culprits are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, or a stray comment. All four are valid JavaScript and invalid JSON. The error message includes a character position to help you locate it.

Does formatting change my data?

No. Only whitespace between tokens changes. Keys, values, types and ordering are all preserved exactly.

Which indent width should I use?

Two spaces is the most common convention and keeps deeply nested structures from running off the screen. Four is easier to scan for shallow documents. Minify for anything being transmitted, since whitespace is pure overhead on the wire.

Is my JSON uploaded?

No. API responses routinely contain tokens, personal data and internal identifiers, so this runs entirely in your browser.