unzippr runs offline · nothing uploads

Anatomy of a ZIP

note 03 · workshop · 5 jul 2026

header + data report.pdf header + data notes.txt header + data photo.jpg TABLE OF CONTENTS every name, size, CRC, and where it starts + "end" marker the index is at the back — like every book that respects a reader in a hurry
fig — read the tail, know everything, touch only what you need.

The ZIP format is a 1989 design (Phil Katz, PKZIP — a shareware legend and a genuinely tragic biography for another day) that has outlived operating systems, companies and formats built to replace it. Its endurance comes down to one structural decision that still looks smart thirty-seven years on: the table of contents lives at the end.

Why the end, of all places

Remember the medium: floppy disks, written front to back, slowly. Putting the directory at the tail meant an archiver could stream files out one at a time — compress, write, move on — and only when finished write the summary of what it had done, with the exact byte offset of every entry. Nothing needed rewriting; nothing needed knowing in advance. The same property is why you could span one archive across five floppies, and why appending a file to a huge zip is cheap: write the new entry over the old directory, then write a fresh directory after it. Design for the constraint honestly and the design outlives the constraint.

The two-copy trick

Each file's metadata exists twice: a local header right before its data (so a damaged archive can be salvaged by scanning forward) and a central directory record at the tail (so an intact archive can be read instantly). An opener like unzippr starts by scanning backward for the end-marker's magic bytes — allowing for the trailing comment field, a classic gotcha — reads the directory in one pass, and can then show you a complete listing having touched maybe two percent of the file. Extraction jumps straight to each entry's recorded offset. Nothing is searched twice; the checksums stamped in the directory become the receipts the integrity column checks against.

The parts that aged less gracefully

Honesty section: original ZIP encryption (1990) is cryptographically quaint and modern tools rightly treat it as a courtesy lock. Filename encoding was codepage chaos until a UTF-8 flag arrived decades in — the garbled characters you've seen in old archives are that history leaking. And the 4GB/65k-entry limits of 16- and 32-bit fields required the ZIP64 extension, grafted on with more headers. unzippr names these edges rather than smoothing over them: encrypted entries are marked, ZIP64 is declined by name, and legacy filenames get the old-codepage reading. A thirty-seven-year-old format has scars; respecting a format means knowing them.