RAR Archive Format: The Proprietary Compression Powerhouse
RAR (Roshal ARchive) was created by Eugene Roshal in 1993 and has remained one of the most widely used archive formats despite being proprietary and not freely open for implementation. RAR's enduring popularity comes from its combination of superior compression ratios, built-in recovery records, multi-volume splitting, and strong encryption. Understanding RAR's technical design explains why it persists alongside open alternatives like 7-Zip and Zstandard.
RAR vs. RAR5: Format Versions
There are two fundamentally different RAR formats in active use:
| Feature | RAR (v4) | RAR5 |
|---|---|---|
| Introduced | 1993/2001 | 2013 (WinRAR 5.0) |
| Signature | 52 61 72 21 1A 07 00 |
52 61 72 21 1A 07 01 00 |
| Dictionary | Up to 4 MB | Up to 1 GB |
| Hash | CRC-32 | BLAKE2sp |
| Encryption | AES-128 + SHA-1 PBKDF2 | AES-256 + SHA-256 PBKDF2 |
| Recovery | Recovery record + volumes | Recovery record |
| Compression | RAR algorithm | RAR algorithm (improved) |
| Unicode filename | Yes | Yes (improved) |
| Solid archives | Yes | Yes |
| Open spec | Partial (unrar SDK) | Partial (unrar SDK) |
RAR5 is the default in WinRAR 5.0+. Most modern tools (7-Zip 9.20+, unrar, p7zip) support both.
RAR Compression Algorithm
RAR uses a proprietary LZ-based compression algorithm with the following stages:
-
Preprocessing: Executable code (x86, x64, ITANIUM, ARM, PowerPC, SPARC, IA-64) is pre-filtered using executable analysis — branch offsets are normalized before compression. This significantly improves compression of binary executables.
-
LZ compression: A sliding window dictionary (up to 1 GB in RAR5) stores references to previously seen byte sequences. Longer matches = fewer output bytes.
-
Prediction modeling: RAR uses a finite-context prediction model (similar to PPM — Prediction by Partial Matching) to assign probabilities to the next byte based on context. This adaptive model significantly outperforms static Huffman coding for mixed binary/text data.
-
Arithmetic coding: The predicted probability distribution is used by an arithmetic coder (more efficient than Huffman for skewed distributions) to produce the compressed output.
The result: RAR typically achieves 2–5% better compression than ZIP and is competitive with 7-Zip at equivalent settings, with faster decompression than LZMA2 for large archives.
Solid Archives
A solid archive is RAR's most powerful compression feature. In a non-solid archive, each file is compressed independently. In a solid archive, all files are treated as a single contiguous data stream for compression purposes.
Benefits:
- Files with similar content across the archive (e.g., many text files, source code, HTML pages) can reference each other's patterns
- Typical improvement: 10–30% better compression for homogeneous file sets
Drawbacks:
- Extracting a single file from the middle of a solid archive requires decompressing all preceding data
- Solid archives cannot be updated — adding one file requires rebuilding the entire archive
- Corruption in one part can prevent extraction of later files
# Create solid archive (WinRAR CLI)
rar a -s archive.rar files/
# Create solid archive (7-Zip)
7z a -ms=on archive.7z files/
Multi-Volume (Split) Archives
RAR pioneered practical multi-volume archive splitting for distributing large files across multiple media (originally floppy disks, later CD-ROMs, now file hosting size limits):
archive.part01.rar
archive.part02.rar
archive.part03.rar
...
Volume naming conventions:
- RAR4:
archive.rar,archive.r00,archive.r01, ... - RAR5:
archive.part1.rar,archive.part2.rar, ... (or.part01.rar)
# Create 500 MB volumes (WinRAR CLI)
rar a -v500m archive.rar largefile.iso
# Extract multi-volume (from first volume)
unrar x archive.part01.rar
# or
7z x archive.part01.rar
Recovery Records
One of RAR's most distinctive features: recovery records are extra parity data embedded in the archive that can recover a limited amount of corruption:
# Add 3% recovery data to archive
rar a -rr3% archive.rar files/
# Repair damaged archive using recovery record
rar r archive.rar
The recovery record uses an interleaving system where each record covers multiple sectors of the archive. If up to N% of the archive data is corrupted (where N equals the recovery record percentage), the original data can be reconstructed.
This feature predates and influenced later systems like PAR2 (Parity Archive Volume Set) used in Usenet newsgroups.
Encryption
RAR supports two encryption modes:
Header Encryption
When header encryption is enabled, the filenames, file sizes, timestamps, and all metadata are encrypted — an attacker cannot see what files are in the archive without the password:
# Password + header encryption (WinRAR GUI: Options → Encrypt file names)
rar a -hp[password] archive.rar files/
Data Encryption Only
Without header encryption, filenames are visible but content is encrypted:
rar a -p[password] archive.rar files/
RAR5 uses AES-256 with PBKDF2-SHA256 (50,000 iterations by default) — significantly more resistant to brute-force attacks than RAR4's AES-128 + SHA-1 PBKDF2.
Opening RAR Files
| Tool | Platform | RAR4 | RAR5 | Create RAR |
|---|---|---|---|---|
| WinRAR | Windows/Linux/Mac | ✅ | ✅ | ✅ (paid) |
| 7-Zip | Windows/Linux/Mac | ✅ | ✅ | ❌ (extract only) |
| unrar | Linux/Mac/Windows | ✅ | ✅ | ❌ |
| The Unarchiver | macOS | ✅ | ✅ | ❌ |
| Archive Utility (macOS) | macOS | ✅ | ❌ (RAR5 not supported) | ❌ |
| Files (Android) | Android | ✅ | ✅ | ❌ |
# Extract with 7-Zip
7z x archive.rar
# Extract with unrar
unrar x archive.rar
# List contents without extracting
7z l archive.rar
unrar l archive.rar
RAR vs. ZIP vs. 7z vs. Zstandard
| Feature | RAR5 | ZIP | 7z | Zstd |
|---|---|---|---|---|
| Compression ratio | High | Medium | Highest | Medium-High |
| Speed (compress) | Medium | Fast | Slow (LZMA2) | Very Fast |
| Speed (decompress) | Fast | Fast | Medium | Very Fast |
| Solid archives | ✅ | ❌ | ✅ | ❌ |
| Multi-volume split | ✅ | ❌ | ✅ | ❌ |
| Recovery records | ✅ | ❌ | ❌ | ❌ |
| Encryption | AES-256 | AES-256 (ZIP 6.3+) | AES-256 | ❌ |
| Header encryption | ✅ | ❌ | ✅ | ❌ |
| Open specification | ❌ (unrar SDK only) | ✅ | ✅ | ✅ |
| Native OS support | ❌ | ✅ (Win/Mac/Linux) | ❌ | ❌ |
When to Use RAR
Appropriate use cases:
- Distribution of large files where multi-volume splitting and recovery records add real value
- Archives requiring filename encryption (more secure than ZIP)
- Environments where WinRAR users dominate (backwards compatibility expectation)
Better alternatives:
- General compression: 7-Zip (better ratio, open format, free)
- Fast compression: Zstandard (near-instant compress/decompress)
- Simple sharing: ZIP (universal native support)
- Long-term archival with recovery: 7z + PAR2
Summary
RAR's strength lies in its combination of features — solid archives, multi-volume splitting, recovery records, and strong encryption — that no single open format matches simultaneously. For pure compression efficiency, 7z with LZMA2 typically wins. For speed, Zstandard wins. But RAR's integrated feature set, particularly recovery records for unreliable transmission channels, keeps it relevant for specific distribution scenarios, especially in contexts where WinRAR remains the dominant tool.
Related conversions
Archive format conversions used most often: