How to Use This Tool
Paste JSON to minify it and see two sizes that matter: the raw saving everyone quotes, and the saving that survives compression, which is the one that reaches the wire.
Why the raw saving is misleading
Minifying JSON removes indentation and line breaks. On a pretty-printed document that is often a third
of the bytes, so the raw saving looks impressive. But almost every JSON response travels over HTTP with
Content-Encoding: gzip, and gzip is extraordinarily good at exactly the thing minifying
removes: repetition. A run of sixteen spaces compresses to almost nothing whether you strip it first or
not.
So after compression the two versions are close. In the measured example a 33% raw saving became an 8% saving once gzipped. The whitespace was 33% of the raw bytes and only 8% of the compressed bytes, because gzip had already dealt with most of it. The panels above compute both numbers for your input, so you can see which situation you are in rather than trusting a headline figure.
When minifying is still worth it
- When the payload is not compressed. Data stored in
localStorage, embedded in a URL, written to a database column, or held in memory is usually not gzipped. There the raw saving is the real saving, and minifying is worth it. - When you have millions of small documents. A few bytes each, multiplied enough times, adds up even after compression — though at that scale a binary format usually beats JSON entirely.
- Parsing speed, marginally. Less text is slightly faster to parse, but the difference is tiny next to network time and rarely the reason to do it.
About the gzip figure
The compressed sizes here are real, not estimated. Your browser has a built-in gzip encoder (the same one behind the Compression Streams API), so this runs the actual DEFLATE algorithm on your text and reports the true byte count. The one caveat is the compression level: browsers use a middle setting, and a server tuned to maximum will land a little smaller. Brotli — which many servers now prefer for text — compresses smaller again. So the gzip number is exact for browser-default gzip and a close upper bound for what a well-configured server sends. If your browser is old enough to lack the API, the panel shows "n/a" rather than inventing a figure.
Minifying is safe; formatting is not the same as changing
Removing whitespace does not change what the JSON means — the parsed value is identical, key order is preserved, and numbers are untouched. One thing to know: this re-serialises the data, so any duplicate keys in the input collapse to the last one, which is what a parser would do anyway. If you need to keep the original bytes exactly, keep the original; minify a copy.
