Why zipping shrinks a report but barely touches your photos.
A ZIP squeezes each file separately by finding repeated patterns. Text and spreadsheets are full of repetition; photos, videos and music are already compressed, so there's nothing left to find. Add files to the folder and watch the archive size.
Each file is stored with a small header in front of it, one after another. The full list of what's inside, with every file's position, comes last. A program opening a ZIP jumps to the end first, then straight to the file you want. The thin strips are headers, the wide blocks are file data; click any block to see what it holds.
This is a complete, valid archive built in your browser from the name and text below: one stored file, its central directory entry and the end record. Edit either box and the sizes, offsets and CRC-32 checksum are recomputed. Click any byte to decode the field it belongs to.
The original format stores file counts in 16 bits and sizes and offsets in 32 bits. Past 65,535 files or 4 GiB those fields overflow. ZIP64, added in 2001, keeps the old fields but fills them with FF placeholders and writes the real 64-bit values elsewhere. Describe an archive and see which limits it hits.
ZIP has an old encryption method from 1989 and a modern one. Both ask for a password, and they look the same when you open the file. Only one of them actually protects the contents.
Word documents, spreadsheets, ebooks, Java programs and Android apps are ZIP archives with an agreed set of files inside. Rename one to .zip and any unzip tool opens it. Since they all start with the same PK bytes, software has to look inside to tell them apart.
Each file has a local header in front of its data and a second entry in the central directory at the end. Most tools read only one of the two, so when they disagree, two programs see two different archives. This page reads both, compares them field by field and decodes every extra field. It also infers the creator’s time zone from the timestamps and checks every CRC by decompressing each file in your browser. Then it writes a clean, reproducible copy without recompressing anything. It all runs on your device, and large archives work, because only headers are read up front.
Identifiers, encodings and registered method codes from PKWARE’s APPNOTE, alongside the dates the format changed.
Other archive formats compress harder or suit other systems.