Introduction
RAR is the archive format of WinRAR, created by Eugene Roshal in 1993. Its compression is proprietary: only WinRAR and RAR can create RAR archives, while the free UnRAR source code lets other programs extract them. It supports solid archives, archives split across several volumes, recovery records that can repair a damaged archive, and encryption.
There are two quite different formats with the same .rar extension. The
current one, RAR 5.0, came with WinRAR 5.0 in 2013. Archives made before that, and by
newer versions when asked for the old format, use the RAR 1.5 to 4.x layout. Both start
with the bytes Rar!, but their headers are built differently, so each has
its own page here.
An archive split across several files in the old naming is a .rar file followed by the parts
.r00, .r01 and on to .r99 (not a hundred separate formats: one kind of file, a part of a multi-volume archive,
with a number in its extension). The explorer tells such a part from a Commodore 64
PC64 REL file, which has the same extensions, by the first bytes: Rar! is a RAR part, and a file
that starts with C64File is the other. The new naming is name.part1.rar, name.part2.rar and so on.
Drop the files of a set together in the explorer and it joins them, so a member that is split over volumes opens whole.
Variations
| Format | Variation | About | Open |
|---|---|---|---|
.RAR | RAR 5.0 archive (RAR5) | WinRAR’s current archive: CRC-32 block headers with variable-length numbers. | Open |
.RAR | RAR 1.5 to 4.x archive (RAR4) | The older RAR format: blocks with a fixed 7-byte header and 16-bit CRC. | Open |
RAR 5.0 (RAR5)
The current format. Headers carry a CRC-32 and store sizes and types as variable-length numbers, so the format has no 4 GB limits. It adds AES-256 encryption, optional BLAKE2 file hashes, larger dictionaries and stronger recovery records.
The file starts with the 8-byte signature 52 61 72 21 1A 07 01 00
(Rar!, then 1A 07 01 00).
Reference: headers and extra records and services.
RAR 1.5 to 4.x (RAR4)
The older format, used from RAR 1.5 until WinRAR 5.0. Every block has a fixed 7-byte header with a 16-bit CRC, a one-byte type and 16-bit flags. Encrypted archives use AES-128.
The file starts with the 7-byte signature 52 61 72 21 1A 07 00
(Rar!, then 1A 07 00).
Reference: blocks and headers.
Not described
Re-checked on 2026-11-12 and 2026-11-13; the explorer items below were updated on 2026-11-19 when it gained the RAR 1.3 to 4.x decompressors, volume sets and the RAR 1.3 and 1.4 format. The RAR 5 pages were checked line by line against RARLAB’s technote and are complete for the headers; the RAR 4 and earlier items still open are listed on the RAR 4 page.
Known, not yet covered
- Reference: the compression algorithms of RAR 3.x to 5.x, implemented in UnRAR’s source (not described by RARLAB’s technote, which says the algorithm is not published) and the encryption details.
- Viewer: RAR 1.5 to 4.x compression is decoded, from UnRAR’s
unpack15.cpp,unpack20.cpp,unpack30.cpp,model.cppandrarvm.cpp: the RAR 1.3 to 1.5 adaptive coder, RAR 2.0 (with its audio blocks), RAR 2.9 to 4.x (Huffman blocks, PPMd variant H blocks and the VM filters) and solid runs, and every member is checked against its CRC-32 (RAR 1.4: its 16-bit checksum). Of the VM filters the six that RAR writes (E8, E8E9, ITANIUM, DELTA, RGB and AUDIO, which UnRAR also recognises by the length and CRC-32 of the program) are run; any other program is shown as text, disassembled, and labelled not run, and the member that needs it is not opened. A member over 64 MB is read in windows, but this decoder has no checkpoints, so a read back from the end decodes again from the start. Checked against libarchive’s and junrar’s archives (RAR 1.4, 1.5, 2.0 with one stereo audio archive, 2.9 and 3.x with PPMd, filters and solid runs). No real archive was found with a RAR 2.0 audio block of three or four channels or with an ITANIUM or RGB filter (the AUDIO filter has the junrar stereo archive). Those routines are checked instead with test vectors made here: a forward filter and a forward audio coder, written from the inverse in UnRAR’srarvm.cppandunpack20.cpp, encode data of many sizes and parameters (1 to 8 AUDIO channels, 1 to 4 RAR 2.0 audio channels, three RGB layouts and ITANIUM at several file offsets), and the decoder must return the original bytes. That shows the decoder agrees with an independent transcription of the same source and that each is exactly invertible; it cannot show that the source was read right where both transcriptions would share a misreading. - Viewer: the “Password” box decrypts encrypted headers and members: RAR 5.0 (AES-256-CBC, key and
password check value from PBKDF2-HMAC-SHA-256, and the keyed CRC-32 and BLAKE2sp of files with “tweaked” checksums, which are
then checked), RAR 3.x and 4.x (AES-128-CBC with RAR’s 0x40000-round SHA-1 key derivation), RAR 2.0 (its own 32-round block
cipher) and RAR 1.5 and 1.3 (their byte stream ciphers), including the encrypted headers of RAR 3.x to 5.x (each header
its own IV or salt). The password is used for the open file only and kept nowhere. Without a password the members are
listed with their encryption fields (rounds, salt, IV, the password check value, whose own checksum is tested) and are not
opened; a RAR 5.0 password check value says at once when the password is wrong, RAR 3.x and 4.x and older carry none, so a
wrong password shows there as a CRC-32 that does not match when a member is read. What this is checked against: archives
built by a writer made for the test, encrypted with Node’s own AES, PBKDF2, HMAC and SHA-1 (RAR 5.0, 3.x and 4.x, with
stored members, a compressed member taken from libarchive’s fixtures, and encrypted headers) and, for RAR 2.0, 1.5 and 1.3,
with forward ciphers written from UnRAR’s
crypt1.cppandcrypt2.cpp, and the PBKDF2 value UnRAR’s own source gives for “password”, “salt”, 1 round. No real encrypted archive was opened with a password, because none of the passwords of the fixtures is the site’s to type; so no archive made by RAR itself has proved this, and the one place where UnRAR’s SHA-1 rewrites its input buffer (a password of about 60 characters or more,sha1_process_rar29) is implemented from the source and not checked against an archive. The RAR 1.3 and 1.4 format (RE~^) uses the same cipher as the RAR 1.3 member of RAR 1.5 to 4.x archives; it was not tested on a built archive of its own. - Viewer: volumes are joined when the files of the set are handed over together (a dropped folder, or
several files selected together):
name.part1.rar,name.part2.rar… orname.rar,name.r00,name.r01…, in RAR 5.0, RAR 4 and RAR 1.4. A member split over volumes opens whole and is checked against the checksum in its last part, and a solid run may cross volumes. The order of the volumes comes from their names, not from the volume numbers in the headers, so a renamed volume would be placed wrongly, and a volume that is missing is named and the members that need it are listed and not opened. A volume opened alone is read as before: a member that continues in another volume is listed with its flags and not opened. - Viewer: the volumes of a set handed over as files (the browser’s File objects) were not found in the
browser on 2026-11-19: a File has its own
bytes()method, which the plugins took for the sign of a source they already read; the test for that was changed to ask forarrayBuffer(), in RAR, tar and six other formats that use companion files. The test of the multi-file drop now opens real File objects through the worker’s own open request. - Viewer: when the archive is opened, members that stand alone are unpacked and checked against their checksums until 64 MiB have been checked. A member past that, and every member that continues a solid run, is checked when it is opened; a failure then joins the Problems list, marked as found after opening, and the Overview’s “Data check” row does not change. A stored member past the 64 MiB (RAR 5 checks its CRC-32 and BLAKE2sp, RAR 4 its CRC-32) is checked when it has been read through to its last byte (opened and parsed whole, or its hex view paged to the end), in pieces of 1 MiB with only the running checksum kept; a failure then joins the Problems list in the same way. A stored member that is only ever read in windows is not read in full to check it, and is not checked.
- Viewer: the quick open data is checked (each structure’s CRC-32, its offset, and that the cached copy equals the archive’s own bytes) but not used to list the members, and the recovery record is shown (size and percentage) and not used to repair a damaged archive.
- Viewer: RAR 5.0 compression is decoded (the Huffman tables, the LZ coder with its four repeated distances, the DELTA, E8, E8E9 and ARM filters, solid runs, compression version 1, and members over 64 MB in windows), and each member’s CRC-32 and BLAKE2sp hash are checked (with the password, also the keyed checksums of encrypted files). The window is the smaller of the dictionary and twice the output of the solid run. Up to 1 GiB it is one typed array. Above that, up to the 1 TB the technote allows, it is a list of 16 MiB pages made as the decoder writes into them and indexed with ordinary numbers, so distances beyond 2 GiB and 4 GiB are followed and the memory held is the smaller of the window and everything written so far, never the declared dictionary. A run stops with a message that gives the sizes when it would hold more than 8 GiB. A window of pages has no checkpoints, so a read back from the end of such a member decodes again from the start. The packed bytes of a member stay in the tree. Tested on archives built here: a distance just past 2 GiB in a stream with a 4 GiB dictionary (compression version 0) and, when asked for, one just past 4 GiB in a stream with a 16 GiB dictionary and the 80 distance codes of compression version 1 (about 4.4 GiB of memory and a minute); no archive made by RAR 7.0 that uses distances like these was available, and distances of 4 GiB to 1 TB (distance codes 66 to 79) were not reached by a test, only by the same code. A dictionary field above 23 in a version 1 header (more than 1 TB), or with a fraction on 23, is reported as a problem.
- Viewer: the RAR 1.3 and 1.4 format (marker
RE~^) is read: the main header, every member header, the stored members and the compressed ones (they use the RAR 1.5 coder in a 64 KB window), with the 16-bit checksum of each. It was checked against one solid RAR 1.4 archive, one empty one and two with a password; the password ones are listed, and open with the Password box as far as the byte stream cipher goes, which has not been run on them (their password is not the site’s to type). The archive comment stored in the main header is shown as bytes.
Unknown
- Reference: the layouts of the RAR 5 ACL, stream and redirection-record service blocks, which the technote says are not published.
- Viewer: the data of the ACL (NTFS permissions) and STM (NTFS stream) service headers is offered as bytes, with no meaning given, for the same reason.
Links
Software
- WinRAR – the archiver that makes RAR files, with command-line RAR for other systems (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)
- UnRAR – RARLAB’s free extractor and its source code (Windows, macOS, Linux)
Reference
- RAR 5.0 archive format – RARLAB’s technical note on the RAR 5.0 headers