🗜️Data Compression Savings Calculator

Pick your content type and size to compare gzip, Brotli, and zstd savings.

MethodCompressed SizeSavings
gzip- KB-%
Brotli- KB-%
zstd- KB-%

The Same File, Different Sizes Depending on the Algorithm

When a web server sends a response, gzip, Brotli, and zstd are the three most common compression algorithms. All three shrink data by finding repeated patterns, but they strike different balances between compression ratio and speed. Brotli tends to achieve the highest ratio on static text assets like HTML, CSS, and JS. Zstd compresses and decompresses fast, making it a strong fit when real-time processing matters. Gzip is older but remains a safe, universally compatible choice.

This calculator takes your original file size and content type — text, JSON, or already-compressed media — and estimates the resulting size and savings for each algorithm. You'll also see that files already compressed by their own format, like JPEG or MP4, gain almost nothing from further compression. Applying gzip or Brotli to such files usually just burns CPU cycles without meaningfully reducing size.

In practice, teams often use Brotli for static text assets and zstd or gzip where compression speed matters more, like real-time API responses. Configuring your CDN or server to support multiple algorithms lets the browser automatically negotiate the best one through Content-Encoding negotiation.

FAQ

Does compressing images or videos shrink them further?

Formats like JPEG, PNG, and MP4 are already compressed, so applying gzip, Brotli, or zstd on top barely reduces their size.

Should I pick Brotli or gzip?

Brotli usually achieves a higher ratio for static text assets, but pairing it with gzip is safer if older browser support matters.

When is zstd the better choice?

Its fast compression and decompression make it ideal for real-time streaming or large-scale data processing where speed is critical.