🧩

JSON Formatter

Beautify and indent messy JSON into readable output.

🔒 Runs entirely in your browser — nothing is uploaded.

How JSON Formatter works

How does the JSON formatter work?

It parses your input with JSON.parse() and re-serializes it with JSON.stringify(parsed, null, space), where space is 2 spaces, 4 spaces, or a tab character depending on the dropdown. The Minify button runs the same parse step but stringifies with no indentation argument at all.

When would I use it?

It is useful for pretty-printing a minified API response so the structure is actually readable, or for compacting hand-formatted JSON before pasting it into a field with a size limit.

Does formatting preserve my JSON exactly as written?

Not byte-for-byte - because it round-trips through JSON.parse, things like key order and duplicate keys (only the last one survives) follow JavaScript's own JSON semantics rather than reproducing your original text verbatim.