ZIP libraries for C/C++
For C and C++ there are 4 good choices:
- libzip reads, creates and modifies ZIP archives (add, replace, rename, delete entries in place). Supports ZIP64, AES and ZipCrypto, bzip2, LZMA, XZ and Zstandard. BSD license. Also used by PHP’s ZipArchive.
- minizip-ng is the successor of zlib’s minizip, with a reader/writer API that extracts or adds whole directories in one call, AES, many compression methods and a compatibility layer for old minizip code. zlib license.
- libarchive has one streaming API for ZIP, tar, cpio, 7z, ISO and RAR (read). Pick it when your program handles several archive formats. BSD license.
- miniz is a single
.c+.hpair with its own DEFLATE: reads and writes ZIP with stored and DEFLATE entries, no encryption. Easiest to embed. MIT license.
Pick libzip when you need to edit archives or encryption, minizip-ng for whole-directory operations, libarchive for many formats, miniz when you want no dependencies.
- libarchive libarchive is a C library that reads and writes ZIP, tar, 7z, cpio and more with one streaming API. How to list and extract ZIP files.
- libzip libzip is a C library to read, create and modify ZIP archives with AES encryption and ZIP64. How to install it, list and extract files, create archives.
- miniz miniz is a single-file C library with DEFLATE, zlib and ZIP reading and writing and no dependencies. How to list, extract and create ZIP files with miniz.
- minizip-ng minizip-ng is a C library for ZIP archives with AES encryption, Zstandard, LZMA and a minizip compatibility layer. How to install it, extract all files.