GZip & zLib Compress / Decompress
This tool compresses and decompresses data using the GZip and zLib support built into your browser, so a compressed payload found in a log, an API response, a cookie or a database column can be read without leaving the page. GZip and zLib use the same underlying compression algorithm with different headers, which is far and away the most common reason a decompression fails — the data is fine, the format setting is wrong. GZip data starts with the bytes 1F 8B and raw zLib usually starts with 78, so a quick look at the first bytes tells you which you actually have.
How it works
Compresses and decompresses data using the browser's built-in GZip and zLib support. Useful for reading a compressed payload out of a log, an API response or a cookie without leaving the browser.
GZip and zLib use the same compression algorithm with different headers, which is the usual reason a decompression fails. GZip data starts with the bytes 1F 8B; raw zLib usually starts with 78.
Everything runs in your browser using its own cryptography — nothing is sent to a server.
Identifying the format
| First bytes | Format |
|---|---|
1F 8B | GZip — always |
78 01 | zLib, no compression |
78 9C | zLib, default compression |
78 DA | zLib, best compression |
50 4B | ZIP archive — a different format entirely |
Decode the first few bytes with the hex tool if you are not sure. It takes seconds and saves guessing.
Where you meet compressed payloads
- HTTP response bodies captured before the client decompressed them.
- Log entries where a large field was compressed before storage.
- Cookies and tokens that pack a compressed payload into a limited size.
- Database columns holding compressed JSON.
Compression ratios
Text compresses extremely well — JSON and logs routinely reach 80 to 90 percent smaller, because both are full of repeated keys and structure. Already-compressed data such as JPEG or ZIP does not compress further and may even grow slightly.
Frequently asked questions
How do I decompress GZip data?
Paste the base64 or hex encoded compressed data, choose GZip, and the decompressed text appears. Compressed data is binary, so it has to be encoded to be pasted at all.
What is the difference between GZip and zLib?
They use the same DEFLATE algorithm with different headers and checksums. GZip adds a filename and timestamp; zLib is more compact. Raw deflate has no header at all.
How do I tell which format I have?
By the first bytes. GZip always starts 1F 8B. zLib usually starts 78 followed by 01, 9C or DA. Raw deflate has no reliable marker.
Why does my decompression fail?
Almost always the wrong format setting, or data that was truncated or mangled by being pasted through something that altered it. Try the other formats before assuming the data is bad.
What if the result is not text?
The decompressed bytes are shown as hexadecimal instead. Compressed data often holds images or serialised binary rather than text.
Is my data uploaded?
No. Compression and decompression use your browser own stream APIs and nothing is transmitted.
Related tools
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to plain text, entirely in your browser, with full UTF-8 support.
Text to Hex Converter
This text to hex converter shows UTF-8 bytes in hexadecimal, and converts them back.
JSON Minifier
This JSON minifier strips whitespace and line breaks to shrink payload size for APIs and config files.