zLib Decompress Online
Inflate zlib and deflate data right in your browser.
zLib Decompress Online
Inflate zlib-compressed data pasted as Base64 or hex, or load a binary file, and see the original text immediately. The tool also handles raw deflate streams and switches to GZip automatically when it sees a 1F 8B header. Everything runs locally with the browser's DecompressionStream API.
What is zlib?
zlib is the compression library written by Jean-loup Gailly and Mark Adler in 1995, and also the name of the data format it produces, defined in RFC 1950. The format wraps a DEFLATE stream with a 2-byte header and a 4-byte Adler-32 checksum at the end. The first byte is almost always 0x78, and the second depends on the compression level — the default 78 9C is the most common. That's why zlib data encoded in Base64 usually starts with eJ (default level) or eN (best compression).
zlib vs GZip vs raw deflate
The same algorithm, three wrappers:
- Raw deflate (RFC 1951) – just the compressed blocks, no header or checksum. Used inside ZIP files and by PHP
gzdeflate(). - zlib – 2-byte header + deflate + Adler-32. Produced by PHP
gzcompress(), Pythonzlib.compress(), JavaDeflater, and Nodezlib.deflateSync(). - GZip – bigger header with magic
1F 8B, file name and timestamp, plus CRC-32. Used for.gzfiles and HTTP.
Confusingly, HTTP Content-Encoding: deflate is supposed to mean zlib, but some old servers sent raw deflate. If decompression fails, try the other option in the Format menu.
Where zlib data shows up
zlib is everywhere under the hood. PNG images store their pixels as zlib streams in IDAT chunks, and PDF files compress page content with /FlateDecode, which is zlib too. You'll also find it in Git objects, WebSocket compression, game save files, Minecraft chunk data, and database fields where applications store compressed JSON. A Python snippet like base64.b64encode(zlib.compress(b'...')) produces exactly the kind of string this tool expects.
Click Sample to inflate an example, or switch to Compress mode to create zlib output from your own text. For .gz files and H4sI strings use GZip Decompress; to decode uncompressed Base64, use Base64 Encode / Decode.
Frequently Asked Questions
What's the difference between zlib, GZip, and raw deflate?
All three use the same DEFLATE compression. Raw deflate is the bare stream with no header. zlib (RFC 1950) adds a 2-byte header like 78 9C and an Adler-32 checksum. GZip (RFC 1952) adds a larger header starting with 1F 8B plus a CRC-32 and the original size. Pick the matching format in the dropdown.
How do I decompress PHP gzcompress() or gzdeflate() output?
gzcompress() produces zlib data, so use the default zlib format. gzdeflate() produces raw deflate without any header, so select Raw deflate. gzencode() produces GZip — the tool detects the 1F 8B header and switches automatically.
What do the header bytes 78 01, 78 5E, 78 9C, and 78 DA mean?
0x78 means DEFLATE with a 32 KB window. The second byte encodes the compression level hint and makes the 16-bit header divisible by 31: 78 01 is no/low compression, 78 5E is fast, 78 9C is the default level, and 78 DA is best compression. In Base64 they typically appear as eAE, eF, eJ, and eN.