A CBR file is a RAR archive of page images, following the same unwritten conventions as CBZ. There is no CBR specification. RAR itself is documented by its maker, RARLAB, in technical notes for both of its versions; readers decompress it with RARLAB’s free UnRAR source code or a library built on it, since writing RAR archives needs WinRAR.
Signatures
The file starts with a RAR marker. Two archive versions exist, and readers must handle both:
| Bytes | As text | Archive | Made by |
|---|---|---|---|
52 61 72 21 1A 07 00 | Rar! SUB BEL NUL | RAR 1.5 to 4.x | WinRAR before 5.0, and later versions when asked; most CBR files from the 2000s |
52 61 72 21 1A 07 01 00 | Rar! SUB BEL SOH NUL | RAR 5 | WinRAR 5.0 (2013) and later, by default |
50 4B 03 04 | PK | ZIP | A CBZ renamed; open it as one |
37 7A BC AF 27 1C | 7z… | 7z | A CB7 renamed |
The RAR marker may also follow a self-extracting program (an .exe
stub); comic readers usually do not look for it there.
Archive settings that matter
The archive header after the marker says how the archive was made. These settings change how a comic reader can get at the pages:
| Setting | RAR 4 main header flag | RAR 5 archive flag | Effect on a reader |
|---|---|---|---|
| Solid | 0x0008 | 0x0004 | Files are compressed as one stream, so to show page 50 the reader must decompress pages 1 to 49 first. Slow for random access; many readers unpack the whole archive at once. |
| Volume | 0x0001 | 0x0001 | The archive is split into several files (.part1.rar, .r00…). Rare for comics, and not supported by most readers. |
| Locked | 0x0004 | 0x0010 | The archive may not be changed; readers can still read it. |
| Recovery record | 0x0040 | 0x0008 | Extra data for repair; ignored by readers. |
| Encrypted headers | 0x0080 | an archive encryption header (type 4) before the main header | Even the file names are encrypted; a reader needs the password to list the pages. |
| Archive comment | 0x0002 | a comment service header | Not used for comic metadata. |
Individual files can also be encrypted with a password while names stay visible. Most comic readers do not support passwords at all. The full header layouts are on the site’s RAR pages.
Pages
- Each page is one image file, usually JPEG or PNG, sometimes GIF, WebP or BMP. Non-image files are ignored.
- Pages are shown in the order of their file names (with their folder paths),
not their order in the archive, usually compared “naturally” so that numbers sort by
value; zero-padded names such as
001.jpgwork in every reader. - The first image is the cover, unless metadata names another.
- RAR stores names in Unicode in RAR 5, and in RAR 4 when the Unicode name flag is set; older RAR 4 archives use the creator’s code page.
Metadata
A CBR file may hold a ComicInfo.xml in the archive root, with the same
elements as in a CBZ: see ComicInfo.xml.
Since RAR archives cannot be changed without WinRAR, tagging programs such as
ComicRack and ComicTagger usually offer to convert a CBR to CBZ before writing
metadata, and the ZIP-comment ComicBookInfo convention does not apply to RAR.