Gzip Compressor
Compress or decompress text and files as gzip, zlib or raw deflate — on your device, never uploaded.
Or drop a file anywhere on the page
The compressed size appears here as you type.
This tool runs your browser's built-in CompressionStream and DecompressionStream — the same deflate algorithm behind gzip, zip and PNG — so
nothing is uploaded and there is no library to download. Choose Compress to
shrink text you type or a file you drop, or Decompress to restore a .gz file or base64 you paste from an API response or a log.
All three formats carry the same deflate data and differ only in the wrapping. gzip adds a 10-byte header and an 8-byte trailer holding a CRC-32 checksum and
the original length; it is what Content-Encoding: gzip, .gz files and .tar.gz archives use. zlib (called "deflate" in HTTP and in the
browser API) adds a 2-byte header and a 4-byte Adler-32 checksum. Raw deflate has no wrapping at all, which is why zip archives and some protocols use it — and why it cannot
be recognised, only chosen.
Wrapping is why tiny inputs grow. Compressing the five bytes of hello as gzip gives
25 bytes: the 18 bytes of header and trailer cost more than deflate can save on five letters.
Compressing nothing at all still produces 20 bytes of gzip, 8 of zlib and 2 of raw deflate.
Repetitive text is the opposite case: one sentence repeated a hundred times — 4,500 bytes —
compresses to about 2% of its size, because deflate replaces every repeat with a short
back-reference to the first. Data that is already compressed, such as JPEG photos, MP4 video
or zip files, has no repetition left to find and usually comes out slightly larger.
When you decompress, the tool reads the first two bytes to tell gzip from zlib and uses the right one whatever the format picker says; raw deflate has no header, so for it the picker decides. Text output is shown and can be copied; anything that is not valid UTF-8 is treated as binary and offered as a download. Decompression stops at 256 MB, so a "zip bomb" — a few kilobytes that inflate to gigabytes — is refused instead of freezing the tab.
For a chosen compression level, bzip2 or LZMA, or decompression as one step in a chain — base64, then gunzip, then parse — use CyberChef. This page does the one step, at the browser's default level.
What is the difference between gzip, zlib and deflate?
They all contain deflate-compressed data. gzip wraps it with an 18-byte header and trailer (including a CRC-32 checksum), zlib with a 6-byte one (an Adler-32 checksum), and raw deflate with nothing. HTTP "Content-Encoding: deflate" actually means zlib.
Why did my compressed output get bigger?
Small inputs pay the fixed header cost — five bytes of text become 25 bytes of gzip — and already-compressed data (JPEG, MP4, zip) has no repetition left for deflate to remove. Neither is an error.
How do I decompress gzip data from an API or a log?
Choose Decompress and paste it as base64, which is how binary data is usually carried in JSON and logs. A data: URL works too. If you have the raw .gz file, choose or drop it instead.
Is my file uploaded anywhere?
No. Compression runs in your browser with its built-in Compression Streams API; the file never leaves your device and the page works offline once loaded.
Can this open .tar.gz or .zip files?
It removes the gzip layer of a .tar.gz, giving you the .tar, but does not list the files inside a tar or zip archive. A zip file stores each member as raw deflate inside its own container format.
Related Tools
Updated October 3, 2026