Format JSON — pretty-printed privately, in your browser

A minified API response is technically readable in the sense that a phone book is technically a novel. This formatter re-indents JSON so you can actually see its structure: pick 2, 4, or 8 spaces and get a cleanly nested file back. It runs completely in your browser, which is worth pausing on — the JSON people paste into online formatters is often the worst possible thing to paste into a website: API responses with tokens and keys, config files with credentials, exports full of user data. Here the file is parsed and re-serialized locally and never transmitted. If the input isn’t valid JSON, you get a clear error instead of mangled output, which also makes this a quick validity check.

How it works

  1. Drop a .json file below (minified or messy — both are fine).
  2. Choose an indent width: 2, 4, or 8 spaces.
  3. Download the formatted file, or fix the reported error if the JSON is invalid.

Frequently asked questions

Is it safe to format JSON that contains API keys or customer data?

Yes, in a way that pasting into a typical online formatter is not. The file is parsed and re-indented by code running in your own browser tab; no request carries your data anywhere. Secrets in the file stay exactly where they were — on your machine.

What happens if my JSON is invalid?

You get a clear error message rather than a half-formatted file. That makes the formatter double as a validator: if it formats, the JSON parses.

Does formatting change my data?

No values change — only whitespace. The file is parsed and re-serialized, so the output is semantically identical JSON with consistent indentation. Note that JSON parsers don’t preserve comments or trailing commas, because standard JSON doesn’t allow them in the first place.

Which indent width should I pick?

Two spaces is the convention in most JavaScript and web projects and the default here. Four is common in Python-adjacent codebases and easier to scan with deep nesting. Eight is mostly useful for presentations and screenshots.