🗜️ Compression Tester
Compare Brotli, Gzip, and Deflate compression side-by-side — see sizes, ratios, and speeds for your data in one view
About this tool
When you serve web assets, API responses, or static files, choosing the right compression algorithm can save significant bandwidth. This tool runs your data through Brotli, Gzip, and Deflate side-by-side and shows the compressed size, ratio, and compression time for each — so you can see which algorithm performs best on your specific content.
Brotli (the newest of the three) typically achieves 15–25% smaller output than Gzip on text-heavy content, but at the cost of a little more CPU time. Gzip is the universal fallback — every browser and server supports it. Deflate is the raw stream underlying Gzip (without the gzip wrapper), sometimes used in ZIP files and raw HTTP Content-Encoding: deflate.
Example: compressing 3,000 characters of repeated Latin text yields roughly 60–120 bytes depending on the algorithm. The tool highlights the winner with a green badge and shows exactly how much smaller it is.
FAQ
When should I use Brotli over Gzip? ›
Use Brotli for text-heavy static assets (HTML, CSS, JS, JSON, SVG) where you compress once and serve many times. Brotli consistently produces 15–25% smaller output than Gzip. For dynamic content that must be compressed on every request, Gzip is faster and still well-supported everywhere. This tool lets you test your actual data to see the difference.
What is Deflate and how is it different from Gzip? ›
Gzip wraps a Deflate stream with a header (filename, timestamp, OS) and a CRC32 trailer. Deflate is the raw compressed stream without the wrapper. In practice, Gzip output is slightly larger (18 bytes of header/trailer) but self-describing. Deflate is used in ZIP archives and older HTTP compression. For web serving, prefer Gzip or Brotli.
Why does my compressed result show a positive size (inflation)? ›
Compression adds per-stream overhead (~10–30 bytes for headers). Very short or already-compressed data (random bytes, encrypted text, JPEG images) can come out larger than the original. Compression works best on repetitive, human-readable text. If all three results are larger than the input, the data is likely already compressed or too short to benefit.
Can I use this to pick a CDN compression setting? ›
Yes. Paste a sample of your typical response payload (JSON API response, HTML page, CSS bundle) and compare the results. If Brotli saves 20%+ over Gzip on your data, enable Brotli in your CDN or reverse proxy. If the difference is marginal (under 5%), Gzip alone is fine and faster.