A general-purpose, patent-free lossless data compression library
open sourceZlibfree
zlib is the general-purpose lossless compression library behind the deflate, zlib and gzip formats, written by Jean-loup Gailly (compression) and Mark Adler (decompression) and free of patents. It's a small C library with in-memory compression and decompression, gzip file reading and writing, and checksums (CRC-32, Adler-32). Version 1.4 (November 2026) brought build changes and several security fixes from audits by Trail of Bits and others.
Problems it solves
- compress data in memory from a C or C++ program
- read and write gzip files in C
- add deflate compression to my file format or network protocol
Features
- deflate, zlib and gzip compression and decompression
- gzip file reading and writing
- CRC-32 and Adler-32 checksums
- patent-free and portable C
Alternatives
The same job
These do what zlib does.
