UTILS.
100% in-browser
🗜️

Gzip / Zlib / Deflate Compress & Decompress

Compress or decompress text with the native gzip, zlib (deflate), or raw DEFLATE formats in-browser, with base64/hex output and the compression ratio.

Enter data above to compress or decompress.

About this tool

The Gzip / Zlib / Deflate tool compresses and decompresses data entirely in your browser using the native CompressionStream and DecompressionStream APIs. Pick the container format — gzip (the .gz format with its 0x1F 0x8B magic bytes), zlib/deflate (the DEFLATE data wrapped in a zlib header), or deflate-raw (bare DEFLATE with no header) — and a direction. Compression takes your UTF-8 text and returns the compressed bytes encoded as base64 or hex; decompression takes base64 or hex and returns the original text.

Because it uses the browser's built-in streaming compression, nothing is uploaded and no external library is loaded — your data stays on your device. The three formats are not interchangeable: gzip and zlib add different headers and checksums (CRC-32 for gzip, Adler-32 for zlib) around the same DEFLATE payload, while deflate-raw omits both, so you must decompress with the same format you compressed with. After compressing, the tool reports the original size, the compressed size, and the compression ratio as a percentage (1 − compressed / original), which is how much smaller the output is.

Highly repetitive text compresses dramatically; short or already-compressed input can actually grow because of the header and checksum overhead, which is normal. If your browser does not expose CompressionStream the tool says so rather than producing wrong output. Note that the native API uses a fixed default compression level, so there is no level selector. Copy the result with one click.

Frequently asked questions

What is the difference between gzip, zlib, and raw deflate?
All three use the DEFLATE algorithm. gzip wraps it with a 10-byte header, magic bytes 0x1F 0x8B, and a CRC-32; zlib (deflate) wraps it with a short header and an Adler-32 checksum; deflate-raw has no header or checksum. Decompress with the same format you used to compress.
What input does decompression expect?
Paste the compressed data as base64 or hex (match the output-encoding selector). The tool decodes it to bytes and inflates it with the chosen format. If the bytes are truncated or the wrong format, it reports that the data could not be decompressed.
Why did my text get bigger after compressing?
gzip and zlib add header and checksum bytes, and DEFLATE needs enough repetition to find savings. For very short or already-random/compressed input that overhead outweighs any gain, so the output can be larger — that is expected.
Can I choose the compression level?
No. The native CompressionStream API does not expose a level parameter, so a fixed default level is used. The output is still a fully valid gzip/zlib/deflate stream that any standard tool (gunzip, zlib, pako) can decompress.

More tools