Brotli vs Zstandard (Zstd) — Which Compression to Use in 2026
Updated April 2026
Reading this? Verify your fix in real-time. Check your compression headers → EdgeFix
Brotli replaced gzip as the best web compression in 2016. In 2026, Zstd offers comparable compression ratios with dramatically faster compression speed. Both have a place — here is how to choose.
The numbers
| Algorithm | Compress speed | Decompress speed | Ratio vs gzip | Browser support |
|---|---|---|---|---|
| gzip level 6 | Baseline | Baseline | Baseline | Universal (100%) |
| Brotli level 4 | ~2x slower | ~1.5x faster | ~15-20% smaller | Chrome, Firefox, Safari, Edge (97%+) |
| Brotli level 11 | ~100x slower | ~1.5x faster | ~20-26% smaller | Same (pre-compress only) |
| Zstd level 3 | ~5x faster than Brotli 4 | ~2x faster | ~15-18% smaller | Chrome 118+, Firefox 126+, Edge 118+ (~78%) |
| Zstd level 10 | ~1x (comparable to Brotli 4) | ~2x faster | ~20-22% smaller | Same as above |
When to use each
Static assets (JS, CSS, fonts) — pre-compress at build time
# Build step: generate all three formats brotli --quality=11 app.js -o app.js.br zstd --level=19 app.js -o app.js.zst gzip --best app.js -o app.js.gz # Serve based on Accept-Encoding # Server picks the best format the browser supports
Dynamic responses (API, server-rendered HTML) — real-time compression
# Use Zstd level 3 for real-time compression (fastest for similar ratio) # Fall back to Brotli level 4 for browsers that do not support Zstd # Fall back to gzip for Safari and legacy browsers
Serve both from Nginx
# The correct order: prefer Zstd, fall back to Brotli, then gzip # Nginx with both modules installed: zstd on; zstd_comp_level 3; zstd_types text/html text/css application/javascript application/json; brotli on; brotli_comp_level 4; brotli_types text/html text/css application/javascript application/json; gzip on; gzip_comp_level 6; gzip_types text/html text/css application/javascript application/json; # Content negotiation: browser sends Accept-Encoding: zstd, br, gzip # Nginx serves the first format it supports from the browser's list
Decision guide
| Situation | Best choice |
|---|---|
| You serve only static, pre-compressed assets | Brotli level 11 (pre-compress) + gzip fallback |
| You serve dynamic API responses | Zstd level 3 + Brotli level 4 + gzip |
| You need the smallest possible files (CDN bandwidth cost) | Brotli level 11 (pre-compress) + Zstd level 19 (pre-compress) |
| You are on Cloudflare or Vercel | Nothing — they handle it automatically |
Check what Cloudflare and Vercel actually serve
# Cloudflare: curl -H "Accept-Encoding: zstd, br, gzip" -I https://yoursite.com | grep content-encoding # Vercel: curl -H "Accept-Encoding: zstd" -I https://yourapp.vercel.app | grep content-encoding
EdgeFix checks your live Content-Encoding header and shows what compression you are actually serving to browsers — alongside your Cache-Control and Vary headers.