Compression Benchmark

Compress your own file with gzip, Brotli and Zstandard at the levels you choose and compare size, ratio, speed and memory, all in the browser.

Your inputs and files stay in your browser

File and codecs

File to compress

Any local file. It stays on this device.

Codecs and levels
levels 0–9
levels 0–11
levels 1–22

CompressionStream of this browser; it has no level setting.

Every codec and level runs in its own Web Worker on a copy of the sample in memory. Nothing is uploaded or saved.

High levels are slow: Brotli 10–11 and Zstandard 19–22 can take minutes on 64 MiB. Start with a smaller sample.

Results

Choose a file to see how small each codec makes it and how fast.

On this page

Compression Benchmark compresses a file you choose with gzip, Brotli and Zstandard at several levels and shows the compressed size, ratio, saved space, compression and decompression speed and WebAssembly memory side by side. It answers which codec and level suit your data, using your data, without uploading it.

Detailed Functionality

The first 1 to 256 MiB of the file are read into memory, then each codec and level runs in a fresh Web Worker: gzip through zlib-compatible Deflate, Brotli with a 4 MiB window and Zstandard with a checksum, all compiled to WebAssembly, plus the browser's own CompressionStream gzip for comparison. Only the codec calls are timed.

With checking on, every result is decompressed in another fresh worker and compared with the original by length and CRC-32, which also measures decompression speed. Because each run starts with an empty WebAssembly heap, the memory column shows what that codec and level actually needed.

The table highlights the smallest output and the fastest compression and can be downloaded as CSV with raw numbers. Any row can compress the whole file with its settings and save it as .gz, .br or .zst.

Practical Examples

JSON API responses: a 16 MiB JSON export shows gzip 6 at about 8×, Brotli 9 near 11× and Zstandard 3 close to gzip's size at several times its speed.

Choosing a level for logs: levels 1, 3, 9 and 19 of Zstandard show where extra CPU time stops buying much size.

Already compressed data: a JPEG or a ZIP gives ratios near 1.0×, which tells you compressing it again is wasted work.

Static assets: compare Brotli 11 with gzip 9 for a bundled JavaScript file before configuring precompressed assets on a server.

How to Use This Tool

  1. Choose a file

    Drop or choose any file. The benchmark starts at once with the default codecs and levels.

  2. Pick codecs and levels

    Turn codecs on or off and type levels such as 1, 6, 9 or a range like 3-5. Choose how much of the file to test.

  3. Run and compare

    Choose Run benchmark. Rows appear as each run finishes; the smallest and the fastest results are highlighted.

  4. Save

    Download the table as CSV, or choose Save on a row to compress the whole file with those settings.

Tips and Best Practices

  • Text, JSON, CSV and logs compress well; images, video and archives barely shrink.
  • Brotli and Zstandard decompress much faster than they compress at high levels, which suits files compressed once and read often.
  • Timings depend on the device and the browser; compare runs made on the same machine.
  • To look inside or extract an archive, use Archive Explorer.

Help shape what comes next

What should we improve next?

Choose one suggestion. These are ideas, not promised features.

Choose one option

The vote sends only the selected choice as an anonymous count. It contains no input, file data, URL, cookie or identifier and is not stored in this browser. Reloading the page allows another vote.