Skip to content


Repository files navigation



liblzw is a small library that provides an API for reading LZW compressed (.Z) files. The API is similar to that of zlib (for reading .gz files) and libbzip2 (for reading .bz2 files) which themselves are just like the classical UNIX functions for reading files (e.g. open/read/fopen/fread/etc...).

The core compression code was taken from the canonical ncompress program.


Since the compression algorithms were ripped out of the public-domain package ncompress, liblzw has also been released into the public-domain for people to do with as they will. Just please send me bugfixes as you find them :).

See the UNLICENSE file for more details.


All existing patents on the LZW algorithm have expired world-wide. So LZW is now patent free.