JSON WalletPrivacy-first JSON & API workspace

JSON Minifier

Strip whitespace and collapse JSON to one compact line.

← All tools

Opens the editor with the sample minified on the left and a tree view on the right. Everything runs locally.

Minifying JSON removes every space, tab and newline that a parser does not need, collapsing a pretty-printed document into a single compact line. The data is identical — only the formatting is gone — but the byte count drops, which matters when JSON travels over the wire, sits in a database column, or gets embedded in a URL or config file.

Why minify JSON

  • Smaller payloads. Removing indentation can cut 20–40% off a human-formatted document, reducing bandwidth and speeding up API responses.
  • Compact storage. One-line JSON is easier to store in a single cell, environment variable, or log field.
  • Embedding. Inline JSON in a data attribute, query string or shell command needs to be free of stray newlines.

Minify and beautify are reversible

Minifying is loss-free: the whitespace carries no meaning, so you can always expand a minified document back into readable, indented JSON. Paste a compact line into the editor and run Format to get it back. Because both directions run on the standard parser, the round trip never changes a single value, key order aside.

How it works here

The minifier parses your JSON and re-serializes it with JSON.stringify(value) — no separators, no indentation. If the document is invalid, it will not minify silently; validate and repair it first, then minify. The left panel shows the compact result you can copy, and the right panel shows the same data as an interactive tree so you can confirm nothing changed.

Nothing leaves your browser

The whole operation is local. Your JSON is never uploaded, so even production payloads with secrets are safe to compress here.

Frequently asked questions

Does minifying JSON change the data?

No. Minifying only removes insignificant whitespace. Every key, value and type stays exactly the same — you can expand it back to formatted JSON at any time with no loss.

How much smaller does minified JSON get?

It depends on how much indentation the original had, but removing whitespace from a pretty-printed document commonly saves 20–40% of the bytes before any gzip compression.

Can I un-minify (beautify) JSON here too?

Yes. Paste the compact JSON into the editor and run Format to pretty-print it with clean indentation.


Related tools

Prefer to start from scratch? Open the JSON editor and paste your own data — everything runs locally in your browser.

Press K for commands