> zlib | compress | decompress <
Compress text or files into the zlib format (RFC 1950) and get Base64 or hex, or paste zlib data to decompress it - all in your browser.
Native & Private
Uses the CompressionStream API built into your browser. Your text and files never leave your device.
Text or Files
Compress typed text or pick a file, then copy the result as Base64 or hex or download the compressed bytes.
Size Report
See original and compressed sizes with the compression ratio so you know exactly what you saved.
// ZLIB TECHNICAL INFO
How It Works:
A zlib stream is a 2-byte header (usually 78 9C), a DEFLATE-compressed body and an Adler-32 checksum of the uncompressed data. It is the format used by PNG image data, Git objects, many network protocols and the zlib library's compress()/uncompress() functions.
Example:
Text "hello" → 78 9C CB 48 CD C9 C9 07 00 06 2C 02 15
Why Use This Tool:
- >Decode zlib payloads from APIs, Git objects and PNG chunks
- >Reproduce what zlib.compress() in Python or Node produces
- >Check the Adler-32 wrapper and header bytes of a stream
- >Create zlib test data for your own decoders
>> frequently asked questions
Q: What is zlib compression?
A: Zlib is both a software library and the compressed data format it produces, defined in RFC 1950. A zlib stream is a small header, a DEFLATE-compressed body and an Adler-32 checksum.
Q: How do I compress text with zlib online?
A: Paste text with COMPRESS selected. The tool outputs the zlib stream as Base64 or hex and shows the size reduction. Choose a file to compress binary data and download the result.
Q: How do I decompress zlib data?
A: Switch to DECOMPRESS, pick Base64 or hex to match your data and paste it. Zlib data usually begins with 78 9C (eJw in Base64), 78 01 or 78 DA.
Q: What do the first two bytes 78 9C mean?
A: The first byte 78 says "DEFLATE with a 32 KB window"; the second byte is flag bits including the compression level hint. 78 01 means no/low compression, 78 9C is the default, and 78 DA is best compression.
Q: How is zlib different from gzip?
A: Zlib has a 2-byte header and an Adler-32 trailer; gzip has a 10-byte header and a CRC-32 + size trailer. The compressed DEFLATE body inside is the same, so one can be converted into the other without recompressing.
Q: What does "incorrect header check" mean?
A: It means the data is not zlib - it may be gzip, raw deflate or corrupted. Try the gzip or deflate tools, or check you picked the correct Base64/hex encoding.
Q: Is my data uploaded?
A: No. Everything runs locally with your browser's built-in compression streams.
// OTHER LANGUAGES
References
How we make sure
We check this tool with the automated test suites linked below. Example checks are shown in their original language.
- Verification method
- Decompress page output in Node and Node output in the page, checking exact bytes.
- Comparison reference
- Interoperability between browser CompressionStream / DecompressionStream and Node.js zlib.
- Verification scope
- These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)
-
encoding-reliability.test.js
- Compression page pipeline: gzip, zlib and raw DEFLATE interoperate with Node zlib
These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.