ZIP libraries
Open-source libraries that read and write ZIP archives. Most languages have ZIP in the standard library (Go, Python, Java, .NET, PHP); use a third-party library when you need AES encryption, newer compression methods (Zstandard, LZMA, XZ), split archives or more control over entry metadata.
| Language | Library | Read | Write | Notes |
|---|---|---|---|---|
| C/C++ | libzip | yes | yes | full-featured, AES, modify archives in place |
| C/C++ | minizip-ng | yes | yes | AES, many methods, minizip compatibility layer |
| C/C++ | libarchive | yes | yes | one API for ZIP, tar, 7z, RAR (read) and more |
| C/C++ | miniz | yes | yes | single file, no dependencies, DEFLATE only |
| C# | System.IO.Compression | yes | yes | built into .NET, no encryption |
| C# | SharpZipLib | yes | yes | AES and ZipCrypto, streaming |
| C# | SharpCompress | yes | yes | ZIP, RAR, 7z, tar; forward-only streams |
| Java | java.util.zip | yes | yes | built into the JDK, no encryption |
| Java | Apache Commons Compress | yes | yes | Unix permissions, ZIP64, split archives |
| Java | zip4j | yes | yes | AES and ZipCrypto, simple API |
| Go | archive/zip | yes | yes | standard library |
| Python | zipfile | yes | yes | standard library; decrypts ZipCrypto only |
| Ruby | rubyzip | yes | yes | the standard Ruby gem, AES in 3.x |
| Rust | zip | yes | yes | pure Rust, AES, Zstandard, LZMA |
| PHP | ZipArchive | yes | yes | bundled zip extension on top of libzip |
By language#
- ZIP libraries for C/C++ Open-source C/C++ libraries to read and write ZIP archives: libzip, minizip-ng, libarchive and miniz. Comparison and code examples.
- ZIP libraries for C# Open-source C# / .NET libraries to read and write ZIP archives: System.IO.Compression, SharpZipLib and SharpCompress. Comparison and code examples.
- ZIP libraries for Java Open-source Java libraries to read and write ZIP archives: java.util.zip, Apache Commons Compress and zip4j. Comparison and code examples.
- ZIP libraries for Go How to read and write ZIP archives in Go with the standard library package archive/zip, with code examples.
- ZIP libraries for Python How to read and write ZIP archives in Python with the standard library zipfile module, with code examples for extracting, creating and appending.
- ZIP libraries for Ruby How to read and write ZIP archives in Ruby with the rubyzip gem, with code examples for extracting, creating and encrypting archives.
- ZIP libraries for Rust How to read and write ZIP archives in Rust with the zip crate, with code examples for extracting, creating and encrypting archives.
- ZIP libraries for PHP How to read and write ZIP archives in PHP with the ZipArchive class from the zip extension, with code examples for extracting, creating and encrypting archives.