BENCH

Gzip / Deflate Compressor

Compress and decompress text with gzip, zlib and raw deflate

How it works

In Compress mode, your text is UTF-8 encoded and compressed with the browser's native CompressionStream — choose gzip (RFC 1952, the .gz / Content-Encoding: gzip format), deflate (RFC 1950, the zlib wrapper) or deflate-raw (RFC 1951, a bare stream) — and the result is shown as Base64 with exact before/after byte counts and the compression ratio. In Decompress mode, paste Base64 (standard or URL-safe) or a hex string of compressed data: the container is auto-detected from its magic bytes (1f 8b for gzip, 78 xx for zlib) with raw deflate as the fallback, and the decompressed text appears instantly — or, if the payload isn't UTF-8 text, you can download the raw bytes. Everything runs locally; gzip output can also be saved as a .gz file.

Frequently asked

Is my data uploaded anywhere?

No. Compression and decompression use the browser's built-in CompressionStream / DecompressionStream APIs and run entirely on your device.

What's the difference between gzip, deflate and deflate-raw?

All three use the same DEFLATE algorithm. gzip (RFC 1952) adds a header and CRC and is used for .gz files and HTTP Content-Encoding: gzip; deflate (RFC 1950) is the lighter zlib wrapper with an Adler-32 checksum; deflate-raw (RFC 1951) is the bare stream with no header at all.

How does decompression know which format I pasted?

It sniffs the magic bytes — 1f 8b means gzip and 0x78 with a valid check byte means zlib — then falls back to trying raw deflate. The detected format is shown with the result.

Can I decompress a hex string instead of Base64?

Yes. Input that looks like hex (only 0-9 a-f, even length) is parsed as hex; anything else is treated as Base64, including URL-safe Base64.

Why is the Base64 output longer than the compressed size?

Base64 encodes 3 bytes into 4 characters, adding about 33% on top of the compressed byte count. The stats line shows the true compressed size in bytes; use Save to download the raw .gz bytes.

Is Brotli or Zstandard supported?

Not yet — browsers don't expose Brotli or zstd through CompressionStream. This tool supports what the platform provides natively: gzip, deflate (zlib) and deflate-raw.