About the zLib Decompress Online
Zlib is the deflate algorithm wrapped in a two byte header and an Adler-32 checksum, and it is what PDF streams, PNG chunks, Git loose objects, Redis dumps and many binary protocols use internally. Those bytes are almost never printable, so they are handed around as Base64 or hex. Paste either form here and the original content comes back, expanded in the page by pako rather than by a server.
The tool tries a full zlib inflate first. If the header is missing, which happens with raw deflate produced by deflateRaw or embedded in a HTTP Content-Encoding: deflate body from an older server, it retries the stream without a wrapper before giving up, so both spellings of deflate are handled without you choosing anything. A stream beginning with 1f 8b is gzip, and the tool says so rather than emitting nonsense.
Zlib headers commonly start with 78 01, 78 9c or 78 da, which is a quick way to recognise a candidate in a hex dump: the second byte encodes the compression level. If the inflate fails, the message from the decoder is passed through, and an incorrect header check almost always means the Base64 was truncated when it was copied. Binary results can be viewed as hex or Base64 instead of text. For the gzip container with its own header and CRC, use GZip Decompress.
How to use
- Paste the zlib or deflate stream as Base64, or as hex bytes.
- Keep the input format on Detect unless the guess is wrong.
- Read the inflated text on the right and check the size figures in the status.
- Use Show result as Hex when the payload is not text.
Common questions
- Does this handle raw deflate without a zlib header?
- Yes. If the zlib header is absent the stream is retried as raw deflate automatically.
- How do I recognise a zlib stream?
- The first byte is usually 78 and the first two bytes together are a multiple of 31, which is the header check the format defines.
- Why does it say incorrect header check?
- The bytes are not a valid zlib stream. Most often the Base64 was cut short during copying, or the data is actually gzip or a ZIP archive.
- Can it inflate a PDF stream?
- Yes, if you extract the bytes between stream and endstream and encode them as Base64 first.