Format Code Now
/

Zlib Decompress Online

ED-68

Paste zlib (deflate) data as Base64 or hex and read the text inside it. It runs in your browser, and you can also compress text to zlib or raw deflate.

Runs in your browser. Nothing is uploaded.

Zlib data as Base64 or hex (or text to compress)

Result

How to use it

  1. Paste the zlib data. Base64 zlib often starts with eJ, and hex starts with 78.
  2. Choose zlib, or Raw deflate if the data has no header.
  3. Click Decompress zlib. Set Output to Hex if the content is binary.
  4. To compress instead, type text and click Compress to zlib.

zlib or raw deflate

A zlib stream is a two byte header (78 9C, 78 01 or 78 DA are the usual ones), deflate data and a checksum. This is what PHP gzcompress and Python zlib.compress produce. Raw deflate is the same compressed data with no header and no checksum, which is what PHP gzdeflate produces. Pick the matching format, because each one fails on the other.

What you get back

The result is shown as UTF-8 text. If the bytes are binary, the tool says how many bytes it got and you can switch Output to Hex. Decompression uses the DecompressionStream in your browser and is capped at 50 MB. Files and URLs are not fetched, so paste the data. Compression uses the browser default level, so the bytes can differ from what your own library writes while still decompressing to the same text.

Error messages and what to do

MessageWhat it meansFix
This is not zlib data: a zlib stream starts with a header such as 78 9C, 78 01 or 78 DA. If it starts with 1F 8B it is gzip.The first two bytes are not a valid zlib header.Use the gzip tool, switch to Raw deflate, or check the pasted data.

Questions people ask

How do I decompress zlib data in Base64?

Paste the Base64, keep the format on zlib and click Decompress zlib. The tool decodes the Base64 and inflates the stream. Zlib Base64 often starts with eJ because the first byte is 78.

How do I decode PHP gzcompress output?

gzcompress writes zlib format, so use zlib. If the data came from gzdeflate, choose Raw deflate. gzencode writes gzip instead, and belongs on the gzip page.

What does inflate mean?

Inflate is the name of the decompression step for the deflate algorithm. Decompressing zlib data and inflating it mean the same thing, and zlib itself uses that word for its function.

Why do I get an invalid data error?

The data may be gzip rather than zlib, cut short, double encoded, or raw deflate while the format says zlib. The tool checks the header and tells you when it is not a valid zlib header.

Which zlib headers are accepted?

Any header whose first byte ends in 8, which means deflate, and whose first two bytes read as one number divide evenly by 31. That covers 78 01, 78 5E, 78 9C and 78 DA.

Can it decompress hex?

Yes. Paste the hex bytes with or without spaces or a 0x prefix, and leave Input on Detect or choose Hex. Output can also be hex if the content is not text.

About this tool

Decompress reads zlib (RFC 1950) data, the format behind PHP gzcompress, Python zlib.compress and many HTTP and database payloads, given as Base64 or hex. Choose Raw deflate for data with no header, such as PHP gzdeflate output. The result is shown as UTF-8 text, or as hex bytes if you set Output to Hex. It uses the DecompressionStream built into your browser and stops at 50 MB. For zlib it checks the two header bytes first and says so when the data is gzip or not zlib at all. Compress writes zlib at the browser default level and returns Base64 or hex. Files and URLs are not loaded: paste the data.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.