Introduction
This is the RAR format used from RAR 1.5 until WinRAR 4.x, and still written by later versions when the old format is chosen. Most RAR files from the 1990s and 2000s use it. Its compression changed over the years (RAR 1.5, 2.0 and 2.9 each brought a new method), but the block layout stayed the same. Encrypted archives use AES-128 from RAR 3.0 on. It was replaced by RAR 5.0 in 2013.
Multi-volume archives were first named name.rar, name.r00,
name.r01 and so on; RAR 3.0 added the name.part1.rar style.
Structure
The archive is a series of blocks, and even the signature is laid out as one. Every block starts with the same 7-byte header. Numbers are little-endian.
0HEAD_CRC low 16 bits of the CRC-32 of the header from HEAD_TYPE on2 bytes2HEAD_TYPE the block type1 byte3HEAD_FLAGS; bit8000means data follows the header2 bytes5HEAD_SIZE the size of the whole header2 bytes7Type-specific fields, starting with the data size when there is data, then the datavaries
The main block types are 72 for the marker (the signature
Rar! 1A 07 00), 73 for the archive header,
74 for a file header, 7A for a subblock such as a comment or
recovery record, and 7B for the end of the archive. A file header gives the
packed and unpacked sizes, the host operating system, the file’s CRC-32, its DOS date and
time, the version needed to extract it, the method (30 for stored up to
35 for best compression), the attributes and the name; the compressed data
follows the header. A self-extracting archive has a program in front of the
signature.
Variants
- RAR 5.0 archive (RAR5) – WinRAR’s current archive: CRC-32 block headers with variable-length numbers
- RAR 1.5 to 4.x archive (RAR4) – the older RAR format: blocks with a fixed 7-byte header and 16-bit CRC
Links
Software
- WinRAR – the archiver that makes RAR files, and still writes this format on request (Windows, macOS, Linux)
- 7-Zip – free archiver that extracts RAR files (Windows)
- The Unarchiver – free extractor for many formats (macOS)
- PeaZip – free archiver that extracts RAR files (Windows, macOS, Linux)
Developers
- UnRAR source – RARLAB’s extraction code (C++)
- libarchive – reads RAR 4 archives among many formats (C)
- rarfile – reads archives with the help of an external extractor (Python)