RAR archive file format
- Typical file name extensions
.rar (for the first volume)
.r00 to .r99 (for volumes #2 to #101)
.s00 to .s99 (for volumes #102 to #201)
- Note that more recent versions of WinRar use a different naming scheme for volumes:
.part1.rar, .part2.rar, ...
- Magic bytes
0x52 0x61 0x72 0x21 0x1a (Rar!<end-of-file>) at offset 0x00
- MIME types
application/x-rar-compressed
- Description
- A file format created by Eugene Roshal for his WinRar / Rar / Unrar programs.
- Compression types
- A variant of LZSS.
- Around RAR version 2.90, a new default compression type was introduced
that cannot be decompressed with older versions.
So beware if you distribute RAR archives created with new versions of WinRar
to an audience with limited computer knowledge.
They may not be able to know what to do with those archives.
- Popularity
- High, especially under Windows, although not as high as ZIP.
Has the somewhat unfair reputation of being a warez
format, mostly because it is easy to create
multi-volume archives with WinRar.
- Meta data
- Optional archive comment.
- Optional comment per entry.
- All kinds of system-specific data (like file attributes) can be added per file.
- Data recovery
- Supports the creation of recovery blocks.
These make the archive files bigger, but can be used to compensate a certain amount of damage to the file.
- Recovery volumes (
.rev files) can be used to replace lost volumes of a multi-volume archive.
When k volumes got lost, any k recovery volumes can be used to make up for the loss.
If different people are missing different volumes, it is sufficient to provide a number of recovery volumes -
as many as the person with largest number of missing volumes is missing.
Thus, one does not have to retransfer each volume someone is missing.
- Encryption
- Supports AES-128 encryption. Brute force (trying all possible passwords) is the only attack against it (to my knowledge).
- ODP lists a few password recovery tools.
- Solid archives possible?
- Yes.
- Support for multiple volumes?
- Yes.
- Other features
- Authentication. Makes it possible to guarantee that a file came from a certain person or institution.
- Unicode. Allows for up to 65,536 different characters.
- Lock. When creating an archive, it can be locked.
This means that WinRar will refuse to modify such an archive.
However, as far as I know locking only means that a bit flag is set in the archive headers.
It should be relatively easy to clear that bit and thus make it possible to modify the archive again.
Thus, this locking mechanism does not provide real security, it just prevents accidental modification.
- Libraries
- The creators of the format distribute code to uncompress
RAR archives.
Both C source code for an unrar command line utility and DLL, OCX and Delphi components (for Windows developers) are available.
- unrarlib - a free C library, based on the above mentioned C code.
- Specification
- A relatively old specification can be found at wotsit.org searching for rar.
Information about the more recent versions of the format can be gathered from the unrar C code provided by
RarSoft (see Libraries).
- Other links
- RarSoft -
Eugene Roshal, creator of the format and the original software.
Next to the popular Windows GUI program WinRar there are command line versions for Linux, Mac OS X, DOS, OS/2 and FreeBSD.
Besides, free decompression utilities are available for a large number of platforms.