Archive6 min

Gzip vs Brotli vs Zstd: Which Compressor Wins in 2026?

Head-to-head comparison of Gzip, Brotli, and Zstd for HTML, JSON, logs, and binaries — with browser and CDN support notes and Zro7 File Compressor recipes.

Compression benchmarks were run locally via Zro7 File Compressor (fflate + brotli-wasm + zstd-wasm). Test files never left the browser.

In 2026, Zstd wins for general-purpose file compression (fast + strong), Brotli wins for static web assets served by a CDN (best ratio for HTML/JS/CSS), and Gzip survives only for universal compatibility. Zro7 File Compressor writes all three in the browser so you can pick per file.

The short table

Numbers below are typical for text-heavy input at each codec's default level; your mileage varies with content.

  • Gzip -6 — ratio 3.1×, compress 90 MB/s, decompress 400 MB/s. Universal.
  • Brotli -6 — ratio 3.7×, compress 30 MB/s, decompress 350 MB/s. Best for text served over HTTPS.
  • Brotli -11 — ratio 4.1×, compress 0.5 MB/s (offline only), decompress 350 MB/s.
  • Zstd -3 — ratio 3.3×, compress 500 MB/s, decompress 1500 MB/s. Best all-rounder.
  • Zstd -19 — ratio 4.0×, compress 5 MB/s, decompress 1500 MB/s. Rivals Brotli-11, decompresses 4× faster.

When to use each

Web assets (HTML, JS, CSS, JSON)

Use Brotli if your CDN supports it (Cloudflare, Fastly, CloudFront, Vercel — all do). Fall back to Gzip via Accept-Encoding negotiation. Brotli's static dictionary is tuned for HTML/JS and beats Gzip by ~20% on those inputs.

Logs, backups, database dumps, ML checkpoints

Use Zstd. It matches Brotli-11 at level 19 while decompressing 4× faster, and its fast levels (1–3) compress at 500+ MB/s — fast enough to enable on every write. Meta uses Zstd in RocksDB, Facebook binaries, and Zstandard file-system for exactly this reason.

Anything that must open on a legacy machine

Use Gzip. Every UNIX shipped since 1992 has it. Brotli requires a modern browser or brotli CLI; Zstd requires zstd CLI (available since ~2016 but not always installed).

Browser support

  • Accept-Encoding: gzip, deflate, br, zstd is emitted by Chrome 123+, Edge 123+, Firefox 126+, and Safari 17.4+. All support Zstd decoding.
  • Compression Streams API supports gzip and deflate natively; Brotli and Zstd still ship as WASM libraries in the browser.

Steps

  1. Open File Compressor.
  2. Drop a file, pick Gzip / Brotli / Zstd, pick a level.
  3. Download the compressed output plus a size / ratio report.

Frequently asked questions

Which is smallest for JSON APIs?

Brotli-11 by a small margin, but Zstd-19 is within 2% and decompresses 4× faster — usually the better pick on the wire.

Which is smallest for already-compressed data (JPEG, MP4, ZIP)?

None. Recompressing lossy media saves ~0.5% and burns CPU.

Is Zstd patent-encumbered?

No. Meta released it under BSD + patent grant; it's an IETF RFC 8478.

Can I dictionary-train Zstd in the browser?

Yes via <code>ZSTD_trainFromBuffer</code> in zstd-wasm. Useful for many small similar payloads (JSON messages).

Any upload?

No. All benchmarks and outputs are computed in your browser tab.

Related posts

← Back to blog