7-Zip
In short: A free, open-source compression program with its own format (.7z), which often achieves better compression ratios than ZIP.
In more detail: Uses the LZMA algorithm by default, which usually achieves higher compression than classic ZIP at the same file size — at the cost of somewhat longer compression time. Besides its own .7z format, it can also open common formats like ZIP or RAR.
In Depth
Origin
7-Zip was released in 1999 by Russian developer Igor Pavlov, at a time when classic ZIP (from the late 1980s), with its then-dominant DEFLATE algorithm, was increasingly seen as outdated in compression terms. Pavlov developed LZMA for it — a new, considerably stronger compression algorithm that was later also used in other projects (including the Linux package tool xz).
Why LZMA compresses more strongly
Compression algorithms like DEFLATE (classic ZIP) and LZMA (7-Zip) work in a similar way at their core: they look for repetitions in the data and replace them with short references to earlier occurrences, instead of storing the repetition again in full. The decisive difference lies in the “dictionary window” — the range of already-processed data that’s searched for repetitions. Classic ZIP limits this window to 32 KB, 7-Zip uses 64 MB by default (even more for very large archives). A larger window detects repetitions even over long distances in the document, which produces noticeably smaller archives especially for large, text-heavy files (source code, logs, database dumps) — at the cost of more memory and longer compression time, since more data has to be kept in memory and searched.
7z a -mx=9 -mmt=4 backup.7z ./project/The -mx=9 parameter selects the highest compression level (slower, but smallest file size; lower levels like -mx=1 compress faster but weaker), -mmt=4 uses four CPU threads in parallel, to compensate for the higher computational load.
Encryption and filenames
7-Zip offers AES-256 encryption for .7z archives, which can optionally also encrypt the filenames themselves — with classic password-protected ZIP, filenames and directory structure usually remain readable in plain text, even if the content is protected. For backups with sensitive filenames (e.g. customer data in the filename), this is a relevant difference.
Compatibility as a trade-off
The main disadvantage of .7z compared to ZIP is how widespread it is: practically every operating system (Windows, macOS, Linux) can natively open ZIP files, without additional software. .7z files almost always need an additionally installed program (7-Zip itself or a compatible tool). For sending to third parties whose software setup you don’t know, ZIP therefore often remains the more pragmatic choice, even if the compression ratio is worse; for internal backups and archiving, where you control your own software environment, .7z is usually the better choice.
Solid archive mode
7-Zip also offers a “solid” mode, where several small files are treated as one continuous data stream during compression instead of individually — this considerably increases the compression ratio further for many similar small files (e.g. a project’s source code files), because repetitions are detected across file boundaries. The downside: to extract a single file from the middle of a solid block, the entire block has to be unpacked up to that point, which slows down individual access for large archives with many files — a classic time-versus-space trade-off.
See also: ZIP, Compressing, Decompressing