All formats

CB7 (Comic Book 7z archive)

Full nameComic Book 7z archive
Extensions.cb7
MIME typeapplication/x-cb7 (not registered with IANA)
Typecontainer (7z archive of images)
Starts with37 7A BC AF 27 1C (7z\xBC\xAF\x27\x1C)
Specificationno formal spec; container is 7z (7-Zip documentation), metadata is ComicInfo.xml
Maintained byno owner (de facto standard); 7z format by Igor Pavlov (7-Zip)
Licenseopen; 7z and LZMA are public domain or LGPL in 7-Zip

A CB7 file is a 7z archive that holds the pages of a comic book as image files, usually JPEG or PNG. A reader opens the archive, sorts the image names and shows them in that order. Rename it to .7z and 7-Zip extracts it.

CB7 is much less common than CBZ and CBR. LZMA2 compression doesn’t shrink JPEG or PNG pages noticeably, and 7z archives are solid by default, which makes opening a single page slow. Most comic readers support it; some e-readers and comic servers don’t.

When to use CB7#

File structure#

A CB7 is a 7z archive. The page and metadata rules are the same as for CBZ: every image entry is a page, pages are sorted by name (natural sort in most readers), the first page is the cover, and an optional ComicInfo.xml carries metadata. See CBZ file structure for the rules, the sort-order pitfalls and the ComicInfo.xml schema.

Akira v01.cb7
├── ComicInfo.xml          optional metadata
├── 0001.png               cover
├── 0002.png
└── ...

A 7z file starts with a 32-byte signature header that points to the end header. The packed streams come first; the header with the list of files, sizes and compression settings is at the end of the file (and is often itself compressed).

37 7A BC AF 27 1C         signature "7z\xBC\xAF\x27\x1C"
00 04                     format version 0.4
xx xx xx xx               CRC-32 of the next 20 bytes
xx xx xx xx xx xx xx xx   offset of the end header
xx xx xx xx xx xx xx xx   size of the end header
xx xx xx xx               CRC-32 of the end header
...                       packed streams (page data)
...                       end header: file names, sizes, folders, codecs

The container details (codecs, filters, encryption) are on the 7z format page.

Solid blocks and page access#

7-Zip creates solid archives by default: many files are compressed together in one “folder” (solid block). To read one file, a decoder starts at the beginning of its block and decompresses everything before it. For a 300-page comic in one solid block, showing the last page means decompressing all 300 pages.

Archive Read page N Typical use
solid (default 7z a) decompress pages 1..N of the block smallest archive
non-solid (-ms=off) decompress page N only comic readers, servers

Readers handle solid CB7 by decompressing the whole archive once into memory or a temporary folder. Libraries with a streaming API (iterate entries in order) read solid archives efficiently; random access by name is slow.

Creating a CB7#

Shell
# non-solid, store only (pages are already compressed): fast page access
7z a -t7z -ms=off -mx=0 "Akira v01.cb7" "./Akira v01/*"
# non-solid with LZMA2, for uncompressed pages
7z a -t7z -ms=off -mx=9 "Akira v01.cb7" "./Akira v01/*"

Zero-pad page numbers (0001.png) so readers without natural sort keep the order.

Converting#

Specifications and documentation#

Software that opens CB7 files#

SoftwareWindowsmacOSLinuxWebCanNotes
SumatraPDF✓viewfree, open source; reads ComicInfo.xml, manga (right-to-left) mode
CDisplayEx✓viewfree comic reader
YACReader✓✓✓viewfree, open source (GPL-3.0)
MComix✓✓viewfree, open source
Kavita✓✓✓✓viewfree, open source reading server
Calibre✓✓✓view, convertfree, open source; converts CB7 to EPUB, PDF
ComicTagger✓✓✓convertfree, open source; converts to CBZ to tag
7-Zip✓✓create, convertfree, open source; creates and extracts 7z
PeaZip✓✓✓create, convertfree, open source archiver

Libraries#

Open-source libraries that read (and some that write) CB7 files, with comic-specific examples (page order, cover, ComicInfo.xml). See all CB7 libraries; general 7z information is on the 7z page.

C/C++libarchive
C#SharpCompress
JavaCommons Compress
Goarchives, sevenzip
Pythoncomicbox, py7zr
Rubyffi-libarchive
Rustcompress-tools, sevenz-rust2