talira

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.

  1. Zstandard Real-time data compression algorithm
  2. Brotli Google's lossless compression format and reference library, with dense compression at deflate-like speed
  3. XZ Utils A complete C99 implementation of the .xz file format
  4. LZ4 Extremely fast lossless compression, with decoding at RAM speed

Compare zlib with the top 3