nih-at/libzip
FreeA C library for reading, creating, and modifying zip archives.
FreeFree tier
About nih-at/libzip
libzip is a portable C library for reading, creating, and modifying zip archives. Developed continuously since 2005, it prioritizes API stability, data integrity (even during errors), and efficiency. It supports reading from files or memory buffers, reverting unsaved changes, Zip64 large archives, multiple compression methods (deflate, bzip2, LZMA, zstd), and encryption (Winzip AES and legacy PKWARE). Licensed under BSD, it is used in major projects like KDE, Chromium, ImageMagick, VeraCrypt, Adobe Lightroom, and the Kobo eReader. It runs on Linux, macOS, Windows, and many other systems, with bindings available for Python, Ruby, Lua, PHP, and others.
Key Features
Reading archives and file data from files or memory buffers
Reverting unsaved changes to maintain data integrity
Zip64 support for large archives (>4GB)
Deflate, bzip2, LZMA, and zstd compression methods
Winzip AES and legacy PKWARE encryption
Stable API with backward compatibility since 2005
Cross-platform: Linux, macOS, Windows, and others
BSD license allows use in commercial products
Pros & Cons
Pros
- Stable and well-maintained API with long history of backward compatibility
- Data integrity guaranteed even in error conditions (no corrupt archives)
- Efficient and small footprint
- Widely adopted in major open-source and commercial projects
- Cross-platform support with no OS-specific dependencies
- Multiple compression and encryption options
Cons
- C library requires integration into projects; not a standalone application
- Documentation relies on man pages, which may be less accessible to some users
- No built-in GUI or command-line interface for end-users
Best For
Software packaging and distribution (e.g., application bundles)Embedded file compression and extraction in applicationsArchiving and backup utilitiesGame asset managementLibrary for implementing custom archive tools
FAQ
What license does libzip use?
libzip is released under the BSD license, which allows use in both open-source and commercial products.
Which platforms does libzip support?
libzip is usable on Linux, macOS, Windows, and many other operating systems.
Are there bindings for other programming languages?
Yes, libzip has bindings for Python, Ruby, Lua, PHP, and several other languages.
Where can I find documentation?
libzip is fully documented via man pages. HTML versions are available on libzip.org and in the man directory of the repository.