Introduction
A CBZ file is a comic book, manga or graphic novel stored as a
ZIP archive of page images. It is not a format with a
specification so much as a convention: renaming a ZIP of scans to .cbz
tells comic readers to show the images one page at a time. The convention became
popular through the CDisplay reader in the early 2000s.
Related extensions use other archive formats: CBR
for RAR, .cb7 for 7z and .cbt for tar.
Structure
The archive starts with the ZIP
signature PK\3\4 and holds one image per page, usually JPEG, PNG or
WebP. Readers sort the files by name to find the page order, so pages are named with
leading zeros, such as 001.jpg, 002.jpg. Images may sit in a
folder inside the archive. Many files also hold a
ComicInfo.xml file, a
metadata convention from the ComicRack program, giving the series, issue number,
title, creators and page types; some carry ComicBookInfo JSON in the ZIP comment
instead.
Divergence from spec
CBZ has no specification for the archive, but its metadata files have written sources: the Anansi Project’s ComicInfo
schemas, the CoMet specification and the ComicBookInfo wiki. Where a program does something those sources do not say,
the page gives both. Four key programs were read, all open source, from raw files on 27 November 2026 (copies in the
project’s research/cbz folder):
ComicTagger, the metadata editor (the comicapi modules comicinfoxml.py and
comicbookinfo.py, master branch, the older code of Anthony Beville, 2012 to 2014; the current development branch
could not be fetched at the addresses tried); Komga, a comic server (ComicInfoProvider.kt,
dto/ComicInfo.kt and BookAnalyzer.kt); Kavita, a comic and book server
(ArchiveService.cs and Models/Metadata/ComicInfo.cs); and YACReader, a desktop
reader and library (common/comic.cpp). ComicRack, the program that began ComicInfo, is closed source and
CDisplay is not read, so neither is covered by a source.
| Place | The specification says | What the programs do |
|---|---|---|
| ComicInfo element order | The schema is an xs:sequence: elements appear in the order listed on the ComicInfo page. | Writes StoryArc and SeriesGroup before AlternateCount and AgeRating before BlackAndWhite (the schema has them after ScanInformation), so its files are out of schema order. Reading uses the first element of each name and does not mind the order. The explorer reports the order once as a recommendation, never as an error. |
ComicInfo BlackAndWhite | YesNo: Unknown, No or Yes. | Writes the element only as Yes; reads yes, true and 1 (any case) as true and everything else as false. So true and 1 are values it accepts that the schema does not allow; the explorer reports them as the schema says. |
| ComicInfo creators | One element for each role, any text; the Anansi documentation says several names are comma separated. | Removes commas from each name when writing, joins the names with commas, and maps roles by synonyms (an “artist” credit is written as both Penciller and Inker; a role it has no synonym for is not written). It reads only Writer, Penciller, Inker, Colorist, Letterer, Editor and CoverArtist, splitting at commas. |
| ComicInfo elements read | 44 elements in the 2.1 draft. | Reads and writes a subset (it has no Translator, Tags, StoryArcNumber, GTIN, Review, CommunityRating or MainCharacterOrTeam); a file it rewrites loses those elements. |
ComicBookInfo issue | The original’s example writes "issue" : 1, a number. | Writes the issue as the string it holds (“3”, “3A”) and reads whatever the JSON has. The explorer accepts both. |
ComicBookInfo lastModified | No format is defined; the original’s example (Internet Archive copy of the wiki’s Example page) writes "lastModified":"2009-10-25 14:51:31 +0000", with a time zone offset. | Writes Python’s str(datetime.now()): local time with a fraction of a second and no time zone offset (2024-05-01 10:00:00.123456 in form), with appID “ComicTagger/1.0.0”. |
| Which file is the ComicInfo | No rule: the file is named ComicInfo.xml; the Anansi documentation describes it at the archive’s root. | Komga takes a member whose whole name is exactly ComicInfo.xml (case matters, so only one at the root) and ignores any other. Kavita takes a member named exactly ComicInfo.xml first; otherwise the first member in any folder whose name merely ends with ComicInfo.xml, in any letter case, unless it is in a folder Kavita blacklists or starts with the macOS metadata prefix (so sub/comicinfo.xml and xComicInfo.xml count). The explorer follows the Anansi description and says when the file is not at the root. |
| Elements read | 44 elements in the 2.1 draft; unknown elements are not defined. | Komga reads 40 of them and ignores unknown elements (ignoreUnknown = true); it has no CommunityRating, Review, MainCharacterOrTeam or Pages. Kavita’s class has no BlackAndWhite, Manga, ScanInformation, CommunityRating, Review, MainCharacterOrTeam or Pages, but holds three names the schema does not define (LocalizedSeries, SeriesSort, UserRating); it removes every empty element before reading and holds Volume as text, where the schema says integer. |
| Several names in one element | The Anansi documentation says comma separated for the creator and list elements. | Komga and Kavita split the creator elements, Genre, Tags, Characters, Teams and Locations at commas and trim the parts. Komga also splits StoryArc and StoryArcNumber at commas and pairs them by position (an arc without a valid number is dropped when numbers are present), and splits Web at spaces where Kavita says it may be comma separated. |
Reading direction (Manga) | Yes and YesAndRightToLeft are separate values: the first marks a manga, the second adds right to left reading. | Komga sets right to left only for YesAndRightToLeft, left to right for No and no direction for Yes or Unknown. |
LanguageISO | A language code; the 2.0 and 2.1 schemas leave it as free text. | Komga keeps it only if it is a valid BCP 47 tag and normalises it; Kavita documents the field as an IETF BCP 47 code. The explorer accepts a code of the shape described on the ComicInfo page. |
| Release date | Year, Month and Day are three separate integers, each may be absent. | Komga makes a date only when Year is present and uses 1 for a missing Month or Day. |
| Page order | None: no source defines it. The explorer sorts picture names in natural order. | YACReader sorts names in natural order ignoring case, then, for fewer than 1,000 pages, looks for double-page files named like 0405.jpg (the most common name prefix is removed; a run of at least 3 and an even number of digits, up to twice the digits of the page count, whose two halves are consecutive numbers, both over 0) and moves them into the sequence by a case-insensitive comparison of whole names. It takes any member whose name ends with a picture extension (case ignored) except names containing __MACOSX, and does not read the ComicInfo Pages list for order. Kavita orders by natural comparison of the name without its extension and skips blacklisted folders and macOS metadata files. Komga treats a member as a page when its detected media type is an image type, not by its extension. |
| Cover | ComicInfo marks a FrontCover page; ComicBookInfo and CoMet have coverImage. | Kavita’s archive code (ArchiveService.cs) takes the first picture, in natural order of the name without its extension, whose name contains “cover” or “folder” as a word (Parser.IsCoverImage, a regular expression in Parser.cs that rejects “back cover”, “backcover” and “covers”), skipping entries in excluded folders (for example __MACOSX) and names starting with ._, else the first picture by natural order, preferring the first folder; it does not consult ComicInfo’s page types. The explorer shows the FrontCover page when ComicInfo names one, else the first page. |
Programs not read: ComicRack (closed source), CDisplay and other readers.
Not described
No specification of the archive exists; the pages record what the common readers do. ComicInfo is covered element by element for all three schema versions.
Known, not yet covered
- Viewer: pages of these types are drawn large: PNG and JPEG, and GIF, WebP, BMP
and TIFF through the site’s own readers for those formats (the same code as when the file is opened alone),
whatever the member’s compression. AVIF and JPEG XL pages are recognised from their first bytes but
cannot be drawn by the explorer, which has no decoder for them: a stored one is handed to the browser
(which draws it if it can) and a compressed one opens only as a file through Open; the page says so in
the Problems list. Pixel sizes are read from the headers of PNG, JPEG, GIF, BMP, WebP, TIFF (the first image’s
ImageWidthandImageLength), AVIF (the primary item’sispe, withclapandirotapplied; checked on files made by macOSsipsandavifenc) and JPEG XL (the codestream’s size header). The JPEG XL size is read from the size header and the orientation field of the image metadata that follows it (an orientation of 5 to 8 swaps width and height; layout from libjxl’simage_metadata.ccandheaders.cc, which is source code and not the ISO 18181-1 text). It is checked on the six files of the libjxl test data (sizes as macOS reports them) and on headers built by hand, because no JPEG XL encoder was available to make a rotated file. A BigTIFF is read for its size (16-byte header, 20-byte entries, LONG8 values) and checked on the nine AWare Systems sample files. ComicInfo’s element order is reported once for the file, as a recommendation, not an error. - Viewer: a
.cbr(RAR) and a.cb7(7z) open as comics through the explorer’s RAR and 7z readers, and a plain.cbt(tar) through the tar reader, with the same pages, ComicInfo, CoMet and (for RAR, from the archive comment) ComicBookInfo. A.cba(ACE 1.0 and 2.0, solid or not) opens as a comic through an ACE reader written for this site from the structure acefile.py documents (headers, the bit stream, the Huffman tables, LZ77, and the delta, executable, sound and picture modes of ACE 2.0); each member is checked against its CRC-32. Not done for ACE: encrypted members (they need a password and the cipher) and members that continue in another volume are listed and named, not unpacked. A.cbtthat is a tar compressed with gzip, bzip2, xz or Zstandard (some tools write a.tar.xzunder that name) is unpacked in memory (up to 256 MiB) and opened as a comic. An encrypted RAR asks for its password (the same Password option as the RAR reader, checked on libarchive’s encrypted RAR files, which hold text, not pictures); a RAR in several volumes has not been tried as a comic. Two real RAR 5.0 files, one 7z and one ZIP comic from the comicbox project were opened, and the same pages as a plain tar CBT written by bsdtar in the ustar, GNU and pax layouts, and as a real.tar.xzplus gzip, bzip2 and Zstandard versions made with the system tools; the ACE reader was checked against acefile.py on six real ACE archives from the Sembiance sample set (one is a two-page ACE 2.0 comic; one,crack.ace, fails in both programs); no encrypted or multi-volume ACE, and no RAR comic that is encrypted or in volumes, was available. - Viewer: the ComicInfo, CoMet and ComicBookInfo readers were run on built files and on the five small real comics above (a ZIP with ComicInfo written by comicbox, a CoMet ZIP, RAR files with ComicBookInfo, a 7z with ComicInfo); they have not seen the variety of files ComicRack, ComicTagger and Mylar write over many years.
Unknown
- Reference: ComicBookInfo has no type table in its original specification (read through the Internet Archive
copy: it defines the JSON container, UTF-8, the ZIP comment, 65,535 bytes and
x-objects, all on the archive page), so the field types are a convention from ComicTagger and the original’s example, not a specification; none can be “checked against the spec”. - Reference: the month range, the 0-based page
Image, the media types of.cb7,.cbtand.cba, and the date of CDisplay’s popularity (“early 2000s”; Wikipedia credits David Ayton’s CDisplay but gives no date) have no primary source. The CoMet specification’s sentence on the 4,000-character limit is damaged in its published text, so the element it applies to is not stated. The explorer checks a CoMet language against the ISO 639-1 list (Library of Congress table). - Reference: the key programs read for “Divergence from spec” are ComicTagger, Komga, Kavita and YACReader (their
sources, kept in
research/cbz). ComicRack and CDisplay are closed source and not read. - Reference: page order, cover choice and ignored-file rules differ between readers; the table states what each of the four programs’ sources does and the page states the common behaviour.
Links
Software
- YACReader – free comic reader and library (Windows, macOS, Linux, iOS)
- SumatraPDF – small, fast free viewer that reads comic archives (Windows)
- calibre – free ebook library manager and reader (Windows, macOS, Linux)
- KOReader – free reader for e-ink devices (e-readers, Android, Linux)
- Okular – KDE’s document viewer, which opens comic archives (Linux, Windows)
Reference
- ComicInfo – the Anansi Project’s schemas and documentation for
ComicInfo.xml - CBR and CBZ – the MobileRead Wiki’s page on comic archives