What is a 7z file?
7z is an open-source archive format introduced with the 7-Zip archiver, created by Igor Pavlov in 1999. It uses the LZMA (Lempel-Ziv-Markov chain Algorithm) compression method, achieving significantly higher compression ratios than ZIP or RAR in most cases. The format is entirely open and documented, with no patents or licensing fees, which has driven its widespread adoption in open-source software distribution.
7z is particularly effective on compressible data like source code, text documents, and executables — often achieving 50-70% smaller archives than ZIP for the same content. Binary and already-compressed files (images, videos, MP3s) see little benefit from any compression algorithm.
How to open 7z files
- 7-Zip (Windows) — Free, native support; right-click context menu integration
- PeaZip (Windows, Linux) — Free, open-source alternative
- The Unarchiver (macOS) — Free, supports 7z natively
- Keka (macOS) — Free archiver with drag-and-drop
- p7zip (Linux) — Official CLI port:
7z x archive.7z - WinRAR (Windows) — Commercial, but reads 7z
Technical specifications
| Property | Value |
|---|---|
| Compression | LZMA, LZMA2, BZip2, PPMd, Deflate |
| Encryption | AES-256 (file content and optionally filenames) |
| Solid archives | Supported (better compression for many small files) |
| Header encryption | Optional (hides filenames from unauthorized access) |
| Multi-volume | Supported (.7z.001, .7z.002, …) |
| Max file size | 16 exabytes (theoretical) |
| Magic bytes | 37 7A BC AF 27 1C |
Common use cases
- Maximum compression: When smallest file size is the priority and extraction speed is secondary
- Software distribution: Open-source project releases on SourceForge and GitHub
- Secure backup: AES-256 encrypted archives protect sensitive data at rest
- Large file sets: Solid compression mode analyzes all files together, finding redundancy across them
- Multi-volume splits: Large archives can be split into fixed-size parts for easier transfer
7z vs ZIP vs RAR comparison
| Feature | 7z | ZIP | RAR |
|---|---|---|---|
| Compression ratio | Best | Moderate | Good |
| Encryption | AES-256 | AES-256 (newer) | AES-256 |
| Filename encryption | ✅ | ❌ | ✅ |
| Native OS support | Windows 11 | ✅ All OS | ❌ |
| Open format | ✅ | ✅ | ❌ (proprietary) |
| Self-extracting | ✅ | ✅ | ✅ |
Solid compression explained
7z’s solid compression mode treats all files in an archive as a single data stream before compressing. This dramatically improves ratios when archiving many similar files (e.g., a folder of .js files or .md documents) because the compressor finds redundant patterns across files. The trade-off is that extracting a single file requires decompressing from the beginning of the stream, making random access slower.
Creating 7z archives from command line
# Compress with maximum compression
7z a -t7z -m0=lzma2 -mx=9 archive.7z /path/to/folder/
# Encrypt with password (AES-256 + filename encryption)
7z a -t7z -mhe=on -p"MyPassword" secure.7z files/
# Extract
7z x archive.7z -o/output/path/
Security considerations
7z’s AES-256 encryption is strong, but the password strength is the real factor. Short or common passwords are vulnerable to brute-force attacks. When sharing encrypted 7z archives, never send the password through the same channel as the archive file. Note that without -mhe=on, filenames are visible even without the password — only file content is encrypted by default.