Skip to content
Aback ZIP

Basics · 5 min read · Updated

What is a ZIP file?

A plain-English explanation of ZIP archives: what they are for, how compression and the central directory work, and why some files do not shrink.

A ZIP file is a single file that contains other files and folders, usually compressed so the whole bundle takes less space. It is the most widely supported archive format there is: Windows, macOS, Linux, iOS and Android can all open ZIP files without extra software.

What a ZIP file does

A ZIP archive does two jobs. It bundles: many files and folders become one file that is easy to email, download or back up. And it can compress: repeated patterns in the data are encoded more efficiently, so the archive is often smaller than the files inside it.

ZIP was created by Phil Katz for PKZIP in 1989, and its specification, PKWARE's APPNOTE, has been public ever since. That openness is a big part of why it became the default archive format almost everywhere.

File types that are secretly ZIP files

Many file types you use every day are ZIP archives with a different extension:

  • .docx, .xlsx, .pptx: Microsoft Office documents
  • .odt, .ods, .odp: OpenDocument files from LibreOffice
  • .epub: e-books
  • .jar, .apk, .ipa: Java, Android and iOS apps
  • .xpi: Firefox extensions

This is why zipping a DOCX file barely changes its size: it is already compressed. You can even open these files in ZIP Viewer to see the XML and images inside.

Inside a ZIP file

PartWhat it holds
Local file headerStarts each file: the signature PK\x03\x04, the name, compression method, timestamp, CRC-32 and sizes.
File dataThe file's bytes, stored as they are or compressed, and optionally encrypted.
Data descriptor (optional)CRC and sizes written after the data, used when a tool streams a file and does not know them in advance.
Central directoryThe index near the end: one record per entry with its name, sizes, method, attributes and where its data starts.
End of central directoryThe last bytes of the file: where the central directory is, how many entries there are, and an optional archive comment.

Readers start at the end, find the central directory and use it to jump straight to any file. That is why a ZIP viewer can list a huge archive quickly, and why a ZIP whose last few bytes are missing, after an interrupted download for example, often refuses to open even though most of the data is there. Repair ZIP works around that by scanning for the local headers instead.

How ZIP compression works

Most ZIP files use Deflate. It replaces repeated sequences of bytes with short references to an earlier copy, then encodes the result with Huffman codes so that frequent symbols take fewer bits. It is lossless: extraction gives back exactly the original bytes.

Each file is compressed separately. That lets you extract one file without decompressing the rest and keeps damage contained to the affected file, but it means ZIP cannot exploit similarities between files the way solid formats such as 7z or .tar.gz can.

MethodIDNotes
Store0No compression. Used for already-compressed files.
Deflate8The standard method. Opens everywhere.
Deflate649Deflate with a larger window; limited support.
BZIP2, LZMA, Zstandard, XZ, PPMd12, 14, 93, 95, 98Higher ratios, but only some apps such as 7-Zip or WinZip can open them. WinZip calls archives that use them .zipx.

Aback ZIP creates Store and Deflate entries, which virtually all ZIP tools can read. It can also extract entries compressed with BZIP2, LZMA, XZ or Zstandard; Deflate64 and PPMd entries are listed in ZIP Viewer but are not decompressed.

Why some files do not shrink

Compression works by removing redundancy, and many common formats have already had theirs removed:

  • JPEG, PNG, WebP and HEIC images
  • MP4, MOV, MP3 and AAC media
  • PDF documents, especially ones full of images
  • DOCX, XLSX and PPTX files, which are ZIP archives themselves
  • Existing ZIP, 7z and RAR archives

Compressing these again is like vacuum-packing something that is already vacuum-packed: it adds a little overhead and rarely saves anything. Good ZIP tools store such files without compression instead.

Checksums, encryption and size limits

Every entry records a CRC-32 checksum of its original contents. After extracting, a reader recomputes it; a mismatch means the data is damaged. CRC-32 reliably catches accidental corruption, but it is not a security feature, because anyone can change a file and its CRC together.

ZIP can encrypt file contents with a password, using the old ZipCrypto scheme or AES. File names stay readable either way. See ZIP encryption: AES vs ZipCrypto.

Classic ZIP fields are 32-bit, which caps files and archives at 4 GB and the number of entries at 65,535. The ZIP64 extension lifts those limits; see ZIP64 explained.

When ZIP is the right format

SituationZIPAlternative
Sending files to people on any computerOpens natively on Windows, macOS and LinuxRarely needed
Many similar text files where size mattersEach entry is compressed on its own7z or .tar.xz can do better on similar files
Keeping Unix permissions and linksAttributes are stored but not honoured everywhereTAR preserves them more reliably
One huge compressible log or datasetDeflate looks back only 32 KBgz or xz when both sides can read them
Password protectionZipCrypto or AES7z for newer encryption options

Aback ZIP reads TAR, GZIP, BZIP2, XZ and Zstandard files and can create .tar and .tar.gz, but it does not create .xz, .bz2 or .zst files.

How a reader opens a ZIP, step by step

  1. Locate the end-of-central-directory record at the end of the file, or its ZIP64 locator in a large archive.
  2. Read the central directory to learn each entry's name, method, sizes and data offset.
  3. Choose which entries to show or extract. A viewer can stop here.
  4. For each chosen entry, seek to its local header and check that the name agrees with the index.
  5. Read the compressed bytes and decompress them with the recorded method.
  6. Recompute CRC-32 and compare it with the stored value.
  7. Write the output using a path that stays inside the destination folder.

The first three steps read only the index. That is why ZIP Viewer can list an enormous archive without unpacking it. Extraction adds the remaining steps; see How to extract a ZIP file.

Why compatibility sometimes differs

The core ZIP layout is public, but several useful features are optional extensions. That is why one application opens an archive while another reports an unsupported format.

  • ZIP64 stores sizes and counts differently, and older tools can misread it.
  • AES encryption is a vendor extension that Windows File Explorer's built-in unzip does not handle.
  • Modern readers honour the UTF-8 name flag; older ones may show garbled names.
  • Extra methods such as Deflate64 and PPMd need an application that implements them.
  • Spanned archives with .z01 parts need a reader that understands spanning.

A plain ZIP with Store or Deflate entries, UTF-8 names and no encryption is the safest choice for a broad audience. Create ZIP produces that kind of archive by default.

Tools for this

Frequently asked questions

Not quite. ZIPX is WinZip's name for ZIP archives that use newer compression methods such as LZMA, PPMd or Zstandard. The structure is ZIP, but many standard tools, including Windows File Explorer, cannot decompress those methods.

More guides