zlib

A Massively Spiffy Yet Delicately Unobtrusive Compression Library
(Also Free, Not to Mention Unencumbered by Patents)

(Not Related to the Linux zlibc Compressing File-I/O Library)


Welcome to the zlib home page, web pages originally created by Greg Roelofs and maintained by Mark Adler. If this page seems suspiciously similar to the PNG Home Page, rest assured that the similarity is completely coincidental. No, really.

zlib was written by Jean-loup Gailly (compression) and Mark Adler (decompression).

Current release:

zlib 1.2.8

April 28, 2013

Version 1.2.8 fixes a very rare bug in decompression. All users are encouraged to upgrade immediately. Version 1.2.8 also has these improvements:

You can also look at the complete Change Log.

Version 1.2.7 has many portability improvements over 1.2.6, and has these enhancements:

Version 1.2.6 has many changes over 1.2.5, including these improvements:

Version 1.2.5 fixes bugs in gzseek() and gzeof() that were present in version 1.2.4 (March 2010). All users are encouraged to upgrade immediately.

Version 1.2.4 has many changes over 1.2.3, including these improvements:

If you are using libxml version 2.7.6 or earlier, you will need to update libxml to version 2.7.7 or later before installing zlib version 1.2.4 or later. libxml 2.7.6 and earlier made unnecessary assumptions about the undocumented internal structure of zlib that were changed in zlib 1.2.4 and result in libxml crashing. This was fixed in libxml 2.7.7.

Version 1.2.3 (July 2005) eliminates potential security vulnerabilities in zlib 1.2.1 and 1.2.2, so all users of those versions should upgrade immediately. The following important fixes are provided in zlib 1.2.3 over 1.2.1 and 1.2.2:

Versions 1.1.4 (March 2002) and later eliminate an earlier potential security vulnerability, see details here. Any software that is linked against or derived from an earlier version of zlib should be upgraded immediately.

A partial list of over 500 applications using zlib is given here.


Canonical URL: http://zlib.net/ (US)


[DDJ's zlib image] zlib is designed to be a free, general-purpose, legally unencumbered -- that is, not covered by any patents -- lossless data-compression library for use on virtually any computer hardware and operating system. The zlib data format is itself portable across platforms. Unlike the LZW compression method used in Unix compress(1) and in the GIF image format, the compression method currently used in zlib essentially never expands the data. (LZW can double or triple the file size in extreme cases.) zlib's memory footprint is also independent of the input data and can be reduced, if necessary, at some cost in compression. A more precise, technical discussion of both points is available on another page.

zlib was written by Jean-loup Gailly (compression) and Mark Adler (decompression). Jean-loup is also the primary author/maintainer of gzip(1), the author of the comp.compression FAQ list and the former maintainer of Info-ZIP's Zip; Mark is also the author of gzip's and UnZip's main decompression routines and was the original author of Zip. Not surprisingly, the compression algorithm used in zlib is essentially the same as that in gzip and Zip, namely, the `deflate' method that originated in PKWARE's PKZIP 2.x.

Mark and Jean-loup can be reached by e-mail at zlib email address. Please read the FAQ and the manual before asking us for help. We are getting too many questions which already have an answer in the zlib documentation.

Greg, Mark and/or Jean-loup will add some more stuff here when they think of something to add. For now this page is mainly a pointer to zlib itself and to related links. Note that the deflate and zlib specifications both achieved official Internet RFC status in May 1996, and zlib itself was adopted in version 1.1 of the Java Development Kit (JDK), both as a raw class and as a component of the JAR archive format.

The lovely zlib-vise image above was provided courtesy of Bruce Gardner, art director of Dr. Dobb's Journal. It appears in Mark Nelson's article in the January 1997 issue (see below).


The current release is publicly available here:

 * zlib source code, version 1.2.8, tar.gz format (558K, MD5 checksum 44d667c142d7cda120332623eab69f40):

 * US (zlib.net)
 * Pick a mirror (prdownloads.sourceforge.net)
 * zlib source code, version 1.2.8, tar.xz format (440K, MD5 checksum 28f1205d8dd2001f26fec1e8c2cebe37):

 * US (zlib.net)
 * Pick a mirror (prdownloads.sourceforge.net)
 * zlib source code, version 1.2.8, zipfile format (678K, MD5 checksum 126f8676442ffbd97884eb4d6f32afb4):

 * US (zlib.net)
 * Pick a mirror (prdownloads.sourceforge.net)
 * zlib compiled DLL, version 1.2.8, zipfile format (139K, MD5 checksum 42eccc2af5bac6b7a1188d7817d03549):

 * US (zlib.net)
 * Pick a mirror (prdownloads.sourceforge.net)

Note that zlib is an integral part of libpng and has been tested extensively as part of many PNG-supporting applications.


zlib Information

 * zlib Frequently Asked Questions
 * Zlib-announce mailing list
New versions of zlib are announced on this list.
 * Zlib-devel mailing list
Please do not send questions or comments about zlib to this mailing list. Send those directly to the authors at zlib email address after checking the FAQ and the manual, of course. The zlib-devel list is for the development of zlib—members are contributors to and testers of new versions of zlib.
 * zlib Manual
 * zlib Usage Example
 * zlib Technical Details
 * zlib-related specifications:
 * zlib's Deflate Algorithm
 * zlib's deflate flush modes
 * Ross Williams' classic "A Painless Guide to CRC Error Detection Algorithms"
 * zlib License
 * zlib on github


Related External Links

 * zlib for Linux, both shared and static plus headers (RPM format, many architectures)
 * zlib for Solaris
 * zlib for Solaris (alternate)
 * zlib for SCO Open Server 5.0
 * zlib for BeOS R5
 * zlib for Mac OS X: zlib is already included as part of Mac OS X
 * zlib for Mac OS
 * zlib for OS/2 (DLL and static version for emx 0.9c, 46k)
(click here if link breaks)
 * zlib for Palm Pilot
 * zlib for Newton OS
 * zlib for Windows CE
 * zlib for RIM BlackBerry
 * zlib for Windows 9x/NT/2000/XP/2003 (DLL version, plus related utilities)
 * zlib for Windows 9x/NT (DLL and static version)
 * DotNetZip zip file manipulation for .NET, and more (including replacements for the buggy Microsoft GZipStream and DeflateStream classes)
 * zlib for .NET in C#
 * zlib DLL wrapper for .NET in C#
 * zlib DLL wrapper for .NET in VB
 * Zip for .NET
 * Mark Nelson's ZlibTool article and Win32 source code for Dr. Dobb's Journal (January 1997)
 * zlib C++ wrapper for the gz* functions.
 * C++ zlib and gzip filters in an iostream framework.
 * zlib 32-bit OCX (C++ source and binaries for use with Visual Basic 4.x or Delphi 2.0)
(unsupported VB5 binary also available)
 * zlib Pascal port (Pascal source, tested with Turbo Pascal 7.0 and Delphi 3.02)
(not tested by us, but looks complete and well-maintained)
 * zlib Delphi 5 interface
(includes compiled object files and corresponding C++ Builder 5 project files)
 * zlib Perl interface (source code; look for Compress-Zlib*.tar.gz)
 * zlib Python interface (online manual; part of the standard library as of Python 1.5)
 * zlib Tcl interface mkZiplib
 * zlib Haskell interface
 * zlib Java interface (see also JAR format)
 * zlib reimplementation in pure Java
(not tested by us, but looks like a good alternative to java.util.zip)
 * Mark Nelson's JavaZip article (with source code) for Dr. Dobb's Journal (December 1997)
 * Random access for gzip archives, for Java
 * Gilles Vollant's zlib-based mini-zip and mini-unzip
(see also Info-ZIP's UnZip, which optionally can be compiled with zlib)
 * Scott Ludwig's zlib-based CExe executable compressor for Win32
 * zlib technical issues, including spec errors
 * zlib information in Japanese
 * zlib information in Russian
 * Real World Scanning and Halftones (second edition includes a section on zlib)
 * Markus Oberhumer's LZO `real-time' data compression library
(not tested by us, but looks like a good alternative if you need more speed and less compression)
 * lz4, a very fast compression algorithm
(not tested by us, but looks like an even better alternative if you need more speed and less compression)
 * libbzip2
(not tested by us, but looks like a good alternative if you need more compression and less speed)
 * PPP Deflate Protocol (RFC 1979)
 * Info-ZIP Home Page
 * Portable Network Graphics (PNG) Home Page
 * gzip Home Page
 * pigz (parallel gzip) Home Page
 * DataCompression.info
 * comp.compression Frequently Asked Questions list


Send comments or questions about zlib to the authors at zlib email address  after checking FAQ and manual.
Please report broken links to Mark's email address (PGP key). Last updated March 26th, 2014.

Web page copyright © 1996-2014 Greg Roelofs, Jean-loup Gailly and Mark Adler.
zlib software copyright © 1995-2012 Jean-loup Gailly and Mark Adler.
zlib.org domain name donated by Andrew Green.