JSON Formatter

Half of all JSON errors are the same three culprits: a trailing comma after the last item, single quotes standing in for double, and an unquoted key. Paste any JSON here and the formatter validates it with the browser's native parser, pretty-prints it at your chosen indent, and when something is wrong it names the character position and the likely offender instead of just saying 'unexpected token'.

The stats line sizes the payload (bytes, keys plus values, nesting depth) - handy for spotting the 200 KB config that grew quietly. Minify collapses it back for transport. Everything runs locally in your browser: API responses with tokens, customer data, draft payloads - none of it leaves the page, which is exactly why a local formatter beats a random web one.

โ€“status
โ€“size
โ€“keys + values
โ€“max depth

  
Everything runs locally in your browser - API keys and payloads never leave this page.

How to use

  1. Paste your JSON - validation and pretty print happen instantly.
  2. Pick 2-space, 4-space or tab indent; Minify collapses for transport.
  3. Fix errors by their reported position, then copy or re-check.

Frequently asked questions

Is my JSON uploaded anywhere?

No - parsing and formatting use the browser's own JSON engine on this page, with zero network calls. That matters for API responses and config files containing tokens; a local formatter is the one that cannot leak them.

Why is my JSON invalid with a trailing comma?

Strict JSON forbids a comma after the final element - {"a":1,} fails. The error usually points just past the real spot. JavaScript objects allow it, which is why code pasted into a JSON context breaks; remove the last comma and it parses.

What's the difference between JSON and a JavaScript object?

JSON is a text format: keys must be double-quoted, no comments, no single quotes, no undefined, and numbers have rules. A JS object literal is looser on all of those. Formatting here validates against strict JSON, so it catches the looseness a browser would silently accept in code.

Does it handle large files?

Comfortably into the megabytes on a normal machine - the limit is your browser's textarea, not a server. For very large payloads the stats line (bytes, node count, depth) gives you the shape before you expand it.

Related tools