Format internals

The CBZ file format, from the bytes up

CBZ has no specification document. What it has is the ZIP specification plus a set of community conventions. Knowing both explains why one comic opens instantly and another stalls at page one.

  • No upload
  • No account
  • Right-to-left ready
  • Remembers your page

A naming convention, not a spec

There is no RFC and no committee. A CBZ is a ZIP archive. The ComicInfo.xml metadata file and the idea of numbered pages come from the ComicRack ecosystem and are followed by most readers. That looseness is why two files with the same extension can behave very differently.

The ZIP layout that makes seeking cheap

A ZIP contains local file headers, each followed by compressed data, plus a central directory at the end that lists every entry and its offset. A reader reads the tail first, builds the page index, then jumps to the exact byte range of the page it needs. Page 180 costs about the same as page 2.

This is also why solid RAR archives are a poor fit for reading: one compressed stream means everything before page 180 must be decompressed first. ZIP does not have that restriction, and CBZ inherits the advantage.

ZIP64 takes over above 4 GiB or 65,535 entries. Most comic archives stay below both, but a full scan run packed into one file can cross the first limit, and older tools may produce an archive that a reader opens incorrectly.

Compression methods: store or deflate

The ZIP specification allows many methods. In practice, comic archives use two: store (method 0) and deflate (method 8). Page images are already compressed, so deflate usually saves very little while costing CPU time on every page open. Many tools store JPEG pages verbatim for that reason.

Other methods exist — bzip2, LZMA, PPMd — and a ZIP using them is still a valid ZIP. Browser-based readers cannot unpack those, which is one reason a CBZ can open on the desktop and fail in a tab.

Page order is a naming convention

The format stores filenames, not page numbers. Readers sort image entries with a natural comparison, so 2.jpg precedes 10.jpg. Zero-padded names such as 001.jpg make the order unambiguous even for tools that sort as plain text.

Folders are usually flattened: chapter 1/001.jpg and chapter 2/001.jpg become consecutive pages in path order. Two files with the same basename fall back to comparing the full path.

Build scripts and macOS add junk entries: __MACOSX folders, .DS_Store, Thumbs.db. This reader filters them out; a reader that does not will show duplicate or blank pages.

ComicInfo.xml

An optional XML file, normally at the archive root, describing the book. The fields that matter for reading are Series, Number, Volume, Title, PageCount, Summary, Year, LanguageISO, BlackAndWhite, and Manga. Manga accepts Yes, No, or YesAndRightToLeft.

This reader uses only Manga and the series/number pair. A malformed or missing file degrades to a neutral title and left-to-right pages instead of an error, because metadata should never block reading.

Encoding and filename quirks

ZIP filenames are bytes. General purpose bit 11 marks a name as UTF-8; without it, old tools wrote CP437 and accented titles turn into mojibake. macOS also stores names in decomposed Unicode, so the same Japanese title can look identical on screen and still compare differently.

None of this changes the images, but it can change sort order and the title shown in the toolbar.

What a browser cannot open

Password-protected entries (ZipCrypto or AES-256), split or multi-volume archives (.z01, .z02), entries compressed with an unsupported method, and RAR or 7z files renamed to .cbz. This reader reports the encrypted and no-image cases explicitly instead of showing a blank page.

Questions

Is CBZ an official format?

No. It is a widely followed convention: ZIP plus comic pages, with optional ComicInfo.xml metadata. Nothing enforces the layout, which is why readers vary.

Does the compression method affect image quality?

No. Store and deflate are both lossless. Quality changes only if a tool re-encodes the JPEGs inside the archive.

Why do my pages appear as 1, 10, 2?

The packing tool or the reader sorted names as plain text. Rename with zero-padded numbers (001, 002, … 010) or use a reader that sorts numbers naturally.

Can I put video or PDF files in a CBZ?

You can put anything in a ZIP, but a comic reader ignores non-image entries. This one lists only JPG, PNG, WebP, GIF, AVIF, and BMP.

What is the difference between CBZ and CB7?

CBZ wraps ZIP, CB7 wraps 7z. CB7 compresses better and is less common; browsers have no built-in 7z decoder, so CB7 stays a desktop-app format for now.

Read a CBZ right now

Drop a file into the reader. It stays on your device.

Open the CBZ reader