Skip to content
{ }JSON Formatter

JSON Minifier

Compress JSON to a single line — strip every space and newline — and see exactly how many bytes you saved.

Input
Output
Paste input and press Minify.

What minifying does

Minification removes every character JSON does not need: spaces, tabs and newlines between tokens. The data itself — keys, values, structure — is untouched, and any parser reads the minified document exactly like the pretty one. The tool validates your input first, so you can't accidentally minify broken JSON; the status bar then reports the result, for example 18,304 B → 11,927 B (34.8% smaller).

When minified JSON pays off

  • API responses and requests — fewer bytes on the wire means lower latency, and at scale, real bandwidth savings.
  • JSON embedded in HTML or JS bundles — inline configuration and preload state count against your page-weight budget.
  • Storage — logs, caches, message queues and database columns holding JSON shrink noticeably.
  • Environment variables and CLI args — JSON crammed into a single line is often the only practical form.

One honest caveat: gzip

If your server compresses responses (gzip or brotli — most do), compression already eliminates most repeated whitespace, so minification on top saves less than the raw percentages suggest — typically a few extra percent, not thirty. Minify-plus-gzip is still the smallest combination, and for uncompressed contexts (env vars, some queues, storage) minification does all the work alone. Need it readable again? The JSON Beautifier reverses this in one click.

Frequently asked questions

Does minifying change my data?

No. Only insignificant whitespace between tokens is removed. Whitespace inside string values is significant and is always preserved. Keys, values, ordering and structure stay byte-for-byte equivalent to a parser.

How much smaller does JSON get?

It depends on how it was formatted. A typical pretty-printed API payload with 2-space indentation shrinks by 25–40%. Deeply nested documents with short values save the most, because they carry the most indentation.

Is minified JSON safe for production?

Yes — minified JSON is the normal form for production traffic. Every standards-compliant parser treats it identically to formatted JSON. Pretty-printing exists for humans, not machines.

Why does my minified JSON still have \n in it?

A \n inside a string is data, not formatting — it represents a real line break in the value and must stay. Minification only removes the whitespace between JSON tokens, never inside strings.

Can I undo minification?

Formatting is fully reversible: paste the minified output into the JSON Beautifier (or the main formatter) and it comes back indented. Nothing is lost in either direction.