ZIP

What is a ZIP file?

The archive format built into every operating system.

What ZIP is

ZIP is a container: a wrapper that holds streams encoded by something else. It is used for moving data between programs and handing a finished file over.

The extension is .zip, and the full name is ZIP Archive. Both matter less than what the file can hold, which is what the rest of this page is about.

Where ZIP came from

PKWARE published it in 1989. The specification is APPNOTE.TXT.

A format that has been readable for that long is a format worth trusting with something you want back in ten years.

The specification is public

It is published in full, so anyone can implement it from the document rather than by inspection, which is why it turns up in so many programs and why files written twenty years ago still open. A published specification is not the same thing as a royalty-free one: where a format wraps a codec, the patent licensing is a separate question the standard does not settle.

Nothing is thrown away

ZIP stores its content exactly. Saving it again changes nothing, so it can be opened, edited and re-saved as often as you like without accumulating damage — which is what makes it a working format rather than a delivery one.

It can hold a whole folder

ZIP stores a directory: names, folders and the structure between them. That is what lets it stand in for a folder in an email attachment.

Where its compression ratio comes from

It works over 32 KB at a time: the span of data repetition has to fall inside before it can be compressed away.

That single number explains most of the difference between one archive format and another. A larger span finds more repetition and takes longer and more memory to do it, which is the whole trade.

What it does to protect itself

ZIP carries a checksum, so a damaged file is detected rather than silently mis-read and optional encryption.

An encrypted file has to be unlocked before anything can convert it, here or anywhere else — a password is not something a converter can work around, and one that claimed to could not be trusted with the file either.

What opens ZIP

Windows Explorer, Finder and 7-Zip read it, and so do most programs of the same kind.

If a file will not open, the format is rarely the problem — it is more often that the program predates it. Converting to something older is the reliable way past that, and it is what the rest of this site is for.

Opening it in a browser

No browser reads it.

That is the single most common reason to convert it: not that the format is bad, but that the place you want to show the file cannot read it.

It is a working format

ZIP is meant to be opened and changed. Keep the file in this format for as long as the work is going on, and export from it whenever a finished copy is needed.

The format you do not have to think about

ZIP is the one archive format every operating system opens without installing anything. Windows has handled it since 1998, macOS since its first release, and every phone, mail client and web browser deals with it. That is the entire reason to choose it, and it is a very good reason.

Everything else in the archive world trades that away for something. RAR compresses better and most recipients cannot open it. 7z compresses better still and needs software. TAR preserves Unix permissions and means nothing on Windows. ZIP wins the case that matters most often: a file being handed to a person whose computer you know nothing about.

Each file is compressed on its own

This is the design decision that explains ZIP’s strengths and its weakness. Every file inside is compressed separately and indexed in a directory at the end of the archive, so any single item can be extracted immediately without touching the rest.

That makes ZIP excellent for archives you dip into and mediocre at ratio. A thousand near-identical text files get squeezed one at a time, with no chance to notice they are nearly the same — which is exactly the case where 7z and `.tar.gz` pull ahead, sometimes by a factor of several.

The password option is two different things

ZIP’s original encryption, added with the 2.0 specification in 1993, is broken. It has known attacks that recover the contents without the password, and tools to do it are freely available. A file protected this way is protected against a colleague being nosy and against nothing else.

Modern ZIP also supports AES-256, which is genuinely strong — but it is not the default in every tool, and an archive encrypted with it cannot be opened by Windows Explorer, which still only understands the old scheme. So the choice is real security that the recipient may not be able to open, or convenience that is not security. For anything that actually matters, encrypt the file before archiving it.

Half the files on your computer are ZIPs already

DOCX, XLSX, PPTX, ODT, EPUB, APK, JAR and Android app bundles are all ZIP archives with a different extension and a required internal layout. Rename any of them to `.zip` and it opens, showing the XML and images inside.

This is why zipping a folder of DOCX files saves almost nothing — the contents are already compressed, and compression cannot usefully run twice. The same holds for JPEGs, MP3s, MP4s and PDFs. If an archive comes out roughly the size of its contents, that is not a failure; it means the files were already doing the job.

What it does not preserve

Unix file permissions, ownership and symbolic links have no reliable home in a ZIP. Some tools store them in an extension field and most ignore it, so a folder of scripts archived on a Mac and extracted on a server frequently arrives without the executable bit set.

That is why software for Unix systems is distributed as `.tar.gz` rather than ZIP, and it is worth knowing before using ZIP to move a project between machines. For documents, photographs and anything a person will open by hand, none of it matters.

The four-gigabyte limit and the extension that removed it

The original specification used 32-bit fields, capping an archive and each file inside it at four gigabytes and the number of entries at 65,535. ZIP64 lifted all three limits in 2001 and is what every current tool writes when it needs to.

Old software does not understand it. The symptom is distinctive: an archive that extracts correctly in one program and reports corruption or truncation in another, usually an older utility or something embedded in a device. The archive is fine; the reader predates the extension.

Mac archives that annoy Windows users

Compressing on macOS adds a `__MACOSX` folder and files beginning with `._` — resource forks and extended attributes that macOS stores separately and packs alongside. On a Mac they are invisible. Extracted on Windows they appear as clutter beside every real file.

They are safe to delete and carry nothing anyone needs. Worth mentioning because it reliably makes a tidy archive look careless, and because the recipient often assumes something went wrong.

Split archives, and why one part is not enough

ZIP can be split across numbered volumes — `.z01`, `.z02`, and a final `.zip` — to get past size limits on email or storage. Every part must sit in the same folder before extraction begins, and the extraction is started from the `.zip`, not from the first numbered part.

They are not independent archives, so a missing part usually makes everything after it unrecoverable. If a split archive fails partway with no clear reason, a missing or renamed volume is the first thing to check.

When something else is the better answer

Choose 7z when the archive is large, full of similar files, and going somewhere you know has the software — the ratio difference is real and can be substantial. Choose `.tar.gz` when the destination is a Unix system and permissions have to survive.

Choose ZIP for everything else, which is most things. The best archive format is the one the recipient can open, and sending anything other than ZIP to someone whose setup you do not know is quietly asking them to solve a problem you could have avoided.

The facts, in one place

Identifiers and provenance for the ZIP format.
Extension.zip
Media typeapplication/zip
Published byPKWARE
First published1989
SpecificationAPPNOTE.TXT

Where these figures come from

The claims on this page are checkable, and these are the documents that settle them.