Black Friday40% off all plans

What Is a ZIP File? How to Open, Create, and Protect One

By Hieu Dinh

What Is a ZIP File?

A ZIP file is a compressed archive: a single .zip file that contains other files and folders, usually packed smaller than the originals. If you're asking "what is a ZIP file" because one just arrived as an email attachment or a download, the short answer is that it's a box of files. Open the box (unzip it) and you get the original files back, bit for bit.

The ZIP file meaning is simple once you know the history. The format was released in 1989 by Phil Katz and his company PKWARE, as part of the PKZIP utility for MS-DOS. The name "zip" was chosen to suggest speed. Katz published the format's specification, called APPNOTE, which let anyone build compatible tools. That openness is why ZIP became the default archive on every desktop and phone, while its competitors stayed niche.

Three facts explain almost every ZIP question:

  1. ZIP opens everywhere without extra software. Windows has handled ZIPs since around 2000, macOS since Mac OS X 10.3, and the iPhone Files app and Files by Google both open them.
  2. ZIP compression is lossless. Nothing is thrown away. Unzipped files are identical to what went in.
  3. ZIP doesn't shrink everything. Documents and code shrink a lot. Videos, photos, and music barely change.

What's Inside a ZIP File

A ZIP is more than a squashed blob. Each file inside is stored separately, with its own header, and a central directory at the end of the archive lists every entry. That design is why you can browse a ZIP's contents instantly, or pull out one file, without unpacking the rest.

PartWhat it holdsWhy it matters
Local file headersName, size, date, and compression method for each fileEach file is compressed on its own, so one damaged file doesn't always ruin the others
Compressed dataThe file contents, usually Deflate-compressedDeflate is fast and supported everywhere
Central directoryAn index of every file, at the end of the archiveLets tools list and extract single files without reading the whole ZIP
Optional encryptionZipCrypto or AES password protectionStrength varies a lot (see below)

Deflate and other compression methods

Almost every ZIP you'll meet uses Deflate, the algorithm PKWARE added in version 2.0 of the spec in 1993. It's a mix of LZ77 (replace repeated chunks with short back-references) and Huffman coding (give common symbols shorter codes). The spec also allows other methods, including Deflate64, bzip2, LZMA, and Zstandard, but support for those is patchy. A ZIP made with LZMA might open in 7-Zip and fail in Finder. When you want a ZIP that opens anywhere, stick with Deflate, which is what every built-in tool uses. For the bigger picture, see what is file compression.

You already use ZIP files every day

Plenty of formats are ZIP archives with a different extension. Word's .docx, Excel's .xlsx, Java .jar files, Android .apk apps, and iOS .ipa apps are all ZIP containers. Rename a .docx to .zip and you can open it and see the XML inside.


Why Some Files Shrink in a ZIP and Media Doesn't

ZIP compression works by finding repeated patterns. Text files, spreadsheets, logs, source code, and uncompressed images like BMP or many TIFFs are full of repetition, so they often shrink to a fraction of their size.

Video, photos, and audio are different. MP4, MOV, JPEG, HEIC, and MP3 have already been through a far smarter, purpose-built compressor (H.264, HEVC, JPEG, AAC) that squeezed out the redundancy. There's almost nothing left for Deflate to find, so zipping a 2 GB video typically saves a few percent at most. Most PDFs behave the same way because their images are already compressed inside.

That's why "just zip it" fails when a video is too big for email. Zipping is for bundling. To make media meaningfully smaller you have to re-encode it. Our guide on how to compress a file covers which approach fits which file type.


How to Open a ZIP File on Any Device

Mac

Double-click the ZIP. Archive Utility, built into macOS, extracts it into a folder next to the original. For the Finder workflow, Terminal commands, and troubleshooting, see our full guide to ZIP files on Mac. If Archive Utility refuses a file, The Unarchiver or Keka usually opens it.

Windows

Double-click the ZIP to browse it like a folder in File Explorer. To extract everything, right-click it and choose Extract All. Extract before you start editing: files opened straight from inside a ZIP are temporary copies, and changes can be lost.

iPhone and iPad

In the Files app, tap the ZIP and iOS expands it into a folder in the same location. You can also press and hold it and choose Uncompress. Downloads from Safari and Mail attachments can be saved to Files first. For the full walkthrough, including ZIPs in Mail and iCloud Drive, read how to unzip files on iPhone.

Android

Open Files by Google, find the ZIP (usually in Downloads), tap it, and tap Extract. Files by Google handles .zip only. Samsung's My Files and most other phone makers' file managers can extract ZIPs too.

Linux

unzip archive.zip                # extract here
unzip archive.zip -d myfolder    # extract into a folder
unzip -l archive.zip             # list contents without extracting

If unzip isn't installed, get it from your package manager, or use 7z x archive.zip.


How to Create a ZIP File

Mac

Select files or a folder in Finder, right-click, and choose Compress. Finder creates Archive.zip (several items) or foldername.zip (one folder). The step-by-step version, with Terminal options, is in ZIP files on Mac.

Windows

On Windows 11, right-click the files and choose Compress to → ZIP File (some builds show Compress to ZIP file). On Windows 10, choose Send to → Compressed (zipped) folder. For more control over compression level and encryption, the best ZIP programs roundup covers 7-Zip, WinRAR, and the rest.

iPhone and iPad

In the Files app, tap Select, choose one or more items, tap More (…), then Compress. A single file becomes filename.zip; several become Archive.zip.

Android

To create a ZIP on Android, Samsung's My Files has a Compress option; on other phones, a free archiver app from the Play Store does the job.

Linux

zip -r archive.zip myfolder      # -r includes subfolders

Password-Protected ZIP Files: ZipCrypto vs AES-256

ZIP supports passwords, but there are two very different kinds of protection, and the tool you use decides which one you get.

ZipCrypto (traditional)AES-256
SecurityWeak. Known-plaintext attacks can break itStrong when the password is strong
Created bymacOS zip -e, many older tools, 7-Zip if you pick it7-Zip, WinRAR, WinZip
Opens in Windows File ExplorerYesNo, the recipient needs 7-Zip or similar
Opens in macOS Archive UtilityYesYes, on macOS 11 Big Sur and later
File names hiddenNoNo

The practical takeaways:

  • ZipCrypto keeps out the casual viewer, not an attacker. It's fine for "please don't open this by accident," not for tax returns or client contracts.
  • For real protection, use AES-256. In 7-Zip, choose ZIP format and set Encryption method to AES-256. From the command line: 7z a -tzip -p -mem=AES256 archive.zip myfolder.
  • File names stay visible in either case. Anyone can list what's inside an encrypted ZIP. If the names themselves are sensitive, use 7z with "encrypt file names" turned on.
  • On a Mac, Finder's Compress has no password option and zip -e uses ZipCrypto. Keka's ZIP encryption is also the legacy method; it uses AES-256 for 7z. For an AES-256 archive on a Mac, a 7z from Keka is the easy route, and how to extract 7z files on Mac explains how recipients open it.
  • Send the password separately. A password in the same email as the ZIP protects nothing.

Are ZIP Files Safe?

The ZIP format is just a container, so a ZIP is as safe as what's inside it. The risks to know:

  • Malware delivery. ZIPs are one of the most common ways to email malicious files. Password-protected ZIPs are a favorite because scanners can't look inside them; an attachment with the password in the email body is a classic phishing pattern.
  • Check extensions inside the archive. A "document" named invoice.pdf.exe, or anything ending in .exe, .scr, .js, .vbs, .bat, or .lnk, is a program. Don't run it unless you trust the sender and expected it.
  • ZIP bombs. A tiny archive can be crafted to expand to an absurd size and fill your disk. The famous 42.zip is about 42 KB and expands to petabytes through nested layers. Modern extractors and antivirus usually catch these, but be suspicious of a tiny ZIP that claims to hold huge files.
  • Path traversal ("Zip Slip"). Badly written extractors can be tricked into writing files outside the target folder. The fix is the same as with any app: keep your OS and archiver updated.

If a ZIP comes from a source you trust, opening it is routine. If it comes from a stranger, and especially if it needs a password, delete it.


ZIP File Size Limits and ZIP64

The original ZIP format had hard limits: 4 GB per file and per archive, and 65,535 files per archive. ZIP64, added to the specification in 2001, lifts those limits so far that you won't hit them (16 exabytes). Every current OS and major archiver supports ZIP64, and modern tools switch to it automatically when an archive gets big.

Two size problems still trip people up:

  • FAT32 drives. Many USB sticks and SD cards are formatted FAT32, which can't hold any single file larger than 4 GB, ZIP or not. Reformat to exFAT or split the archive.
  • Upload and attachment caps. Email services and chat apps limit attachment size. Zipping won't help much if the bulk is video. You can split an archive into parts with zip -s 1g -r archive.zip folder (Info-ZIP) or 7-Zip's "Split to volumes" option, but recipients then need every part.

ZIP vs RAR vs 7z

ZIP isn't the only archive format, and it isn't the most efficient one. Here's how it compares with the other two you'll run into:

ZIPRAR7z
Created1989, PKWARE1993, Eugene Roshal1999, Igor Pavlov
Typical compressionDeflateProprietary RAR algorithmLZMA / LZMA2
Archive sizeLargest of the threeSmallerUsually smallest
Open without installing anythingWindows, macOS, iOS, AndroidWindows 11 (23H2+) onlyWindows 11 (23H2+) only
Create for freeYes, built into every OSNo, needs WinRARYes, 7-Zip or Keka
EncryptionZipCrypto or AES-256AES-256 (RAR5)AES-256
Hide file namesNoYesYes
Repair a damaged archiveNoYes, recovery recordsNo

Use ZIP when someone else has to open the file and you don't know what they're running. Use 7z when you want the smallest archive or encrypted file names and the recipient can install 7-Zip. Use RAR if you need recovery records for long-term storage. The deeper comparisons are in what is a RAR file and 7z vs ZIP.


When ZIP Isn't the Answer: Shrinking Media

If the files you're zipping are videos, photos, or scanned PDFs, the ZIP will be nearly as big as the originals. The real savings come from re-encoding the media itself.

Compresto does that on macOS: it compresses video, images, GIFs, and PDFs locally on your Mac, in batches, and can aim each file at a target size you type in. Compress the media first, then zip the results if you still want a single file to send.


Frequently Asked Questions

What is a ZIP file?

A compressed archive that bundles files and folders into one smaller .zip file. PKWARE released the format in 1989, and most ZIPs use Deflate compression. Every major OS opens it without extra software.

How do I open a ZIP file?

Mac: double-click. Windows: double-click to browse, or right-click and choose Extract All. iPhone: tap it in Files. Android: Files by Google, then Extract. Linux: unzip file.zip.

How do I create a ZIP file?

Mac: right-click and choose Compress. Windows 11: right-click and choose Compress to, then ZIP File. iPhone: select in Files, then More and Compress. Linux: zip -r archive.zip folder.

Are ZIP files safe?

The format is safe; the contents might not be. Be wary of password-protected ZIPs from strangers and any executable file inside. Keep your extractor and OS updated.

Is a password-protected ZIP file secure?

Only with AES-256. ZipCrypto, the older default in many tools, can be cracked. Use 7-Zip or WinRAR for AES-256, and remember File Explorer can't open AES ZIPs.

Is ZIP better than RAR or 7z?

ZIP is more compatible; 7z and RAR compress better. Use ZIP for sharing, 7z for the smallest free archive, RAR for recovery records.


The Short Version

A ZIP file is the universal archive: lossless, free to create, and openable on every computer and phone without installing anything. It shrinks documents well and media barely at all, its built-in password protection is weak unless you choose AES-256, and 7z or RAR beat it on size when compatibility doesn't matter.

Download Compresto for Mac →


Ready to compress your files? Join thousands of creators using Compresto ⚡