Everything you need to know about ZIP
ZIP (.zip) is the ubiquitous archive format - PKWare's 1989 invention that became the default way to bundle and compress files on every operating system. The format combines DEFLATE compression (same as PNG and gzip) with a flexible directory structure that supports streaming, encryption, and partial extraction.
How it works under the hood
- Central directory at the end. The 'index' of files lives at the END of the ZIP. This is why you can append to a ZIP without rewriting everything - just add new entries and update the directory.
- Per-file compression. Each file inside is compressed independently with its own algorithm (Stored = no compression, Deflate = standard, Deflate64, BZIP2, LZMA).
- Streamable. Local file headers precede each file's compressed data - tools can extract files as they're downloaded without seeking back.
- ZIP64 for big files. Original ZIP capped at 4GB total / 65535 files. ZIP64 (since 2001) lifts these limits to 16 EB / 4 billion files.
Where you'll actually use it
- Software distribution (every download bundled in ZIP)
- Email attachments combining multiple files
- Office Open XML (DOCX, XLSX, PPTX are all ZIPs)
- Backup archives and version snapshots
How it compares to alternatives
ZIP vs TAR: TAR doesn't compress (combine with gzip = .tar.gz); ZIP compresses per-file. ZIP vs 7z: 7z compresses better (~20-30%) and supports stronger encryption. ZIP vs RAR: Both proprietary, ZIP is more universal.
Things that will trip you up
- ZIP encryption (zipcrypto) is broken - use AES-256 (WinZip 9 / 7-Zip variant) for real security
- Filename encoding: legacy ZIPs use IBM Code Page 437; modern uses UTF-8 with a flag - filename mojibake is common with Asian characters
- Macs add hidden files (`__MACOSX/`, `.DS_Store`) to ZIPs created in Finder - sanitize before sharing