How to zip a file on Mac, open a zip, and add a password
Also in日本語한국어繁體中文简体中文EspañolDeutschPortuguês (Brasil)Français
Quick answer
To zip a file on a Mac, Control-click it in the Finder and choose Compress. One item gives a zip with its own name, several give Archive.zip, and a double-click opens any zip. We also tested what a Finder-style zip carries inside, how to leave Mac metadata out, and why a zip password is weak protection.
Download for MacDownload on the App StoreTo zip a file on a Mac, Control-click it in a Finder window or on the desktop and choose Compress. One item becomes a zip with the same name plus .zip. Select several items first and you get a single file called Archive.zip. To unzip, double-click the zip and its contents appear in the same folder. Apple documents no password option for Compress, so a locked zip takes one Terminal command.
How do you zip a file or folder on a Mac?
Apple's macOS 27 guide, Zip and unzip files and folders on Mac, gives one route:
- In a Finder window or on the desktop, select the file or folder, or several items for one zip.
- Control-click the selection. A right-click does the same; see our right-click guide.
- Choose Compress from the shortcut menu.
A single item keeps its name with .zip added, and several items become Archive.zip. Apple doesn't say where the new zip is saved, so look in the folder that held the originals first, then search for the name with Spotlight.
If Compress fails, Apple's troubleshooting page points to permissions: choose File › Get Info and check Sharing & Permissions.
How do you unzip a file on a Mac?
Double-click the .zip file. Apple says the unzipped item appears in the same folder as the zip, which you can then delete. If a zip won't open, check that the Mac has room for what's inside; if someone sent it, it may be damaged, so ask them to zip it again.
On our Mac (macOS 27.2.1), zips open in Archive Utility, kept in /System/Library/CoreServices/Applications. Apple's macOS 27 guide doesn't mention it or its settings, so we leave them alone.
Which way of zipping fits what you need?
| You want | Use | What we found inside |
|---|---|---|
| To send a file or folder quickly | Finder's Compress | Your files, a __MACOSX folder of ._ files and any .DS_Store (our ditto test, below) |
| A clean zip for Windows or an upload form | zip -r with -x "*.DS_Store" |
Only your files |
| A password | zip -er |
Encrypted contents, file names still readable |
| To shrink photos or video | Zip won't help much | 11% off a JPEG, under 1% off an MP4 |
What does a Finder zip carry besides your files?
The ditto manual (man ditto) gives ditto -c -k --sequesterRsrc --keepParent as the command that "will create a PKZip archive similarly to the Finder's Compress functionality". We ran it on macOS 27.2.1 and listed the zip with zipinfo; we didn't test Finder itself.
- A
__MACOSXfolder, with a._file for every file we zipped. The manual says--sequesterRsrckeeps resource forks and HFS metadata there. We gave one file a Finder tag and another a download quarantine flag, and macOS had added an attribute calledcom.apple.provenanceto every file by itself, even to files made in Terminal. - The
.DS_Storefile, with a._partner of its own.
ditto -x -k folded the metadata back in: the tag returned and no __MACOSX folder appeared. Terminal's unzip doesn't know Apple's convention and unpacked __MACOSX as an ordinary folder. So someone opening your zip with a tool like that, on Windows for example, may see it. It holds only Mac metadata and can be deleted.
How do you make a zip without __MACOSX and .DS_Store files?
Use zip, which comes with macOS. Open Terminal from Spotlight or /Applications/Utilities, as Apple's Terminal guide shows, then run:
cd ~/Desktop
zip -r MyFolder.zip MyFolder -x "*.DS_Store"
Use your folder's name, in quotes if it has spaces. Per man zip, -r includes the folder's contents and -x leaves out files matching a pattern. Our test zip had no __MACOSX, ._ or .DS_Store files. The trade-off: tags and other Mac metadata stay behind, which matters only if you want them on another Mac.
How do you password-protect a zip on a Mac?
Apple's macOS 27 steps for Compress include no password option. In Terminal:
zip -er Private.zip MyFolder
zip asks for the password twice and hides what you type. Avoid -P, which puts the password on the command line: the manual calls that insecure and zip's standard encryption "relatively weak", and recommends strong encryption such as Pretty Good Privacy where security truly matters. One more limit from our test: zipinfo listed every file name in the locked zip without the password. unzip Private.zip asks for it; we didn't try a locked zip in Finder.
Does zipping shrink photos and videos?
Hardly. In our test a JPEG shrank by 11% and an MP4 by under 1%, while the text of the zip manual lost 67%. The manual says zip has one compression method, deflation, and that 2:1 to 3:1 is common for text. JPEG and MP4 are already compressed formats, so a zip keeps them together but saves little space.
How do you share a Shimeji pack as a zip?
We make Shimejiko, a Mac app for animated Shimeji desktop pets, and its Library's drop zone asks for a Shimeji zip. To share a pack you drew, compress its folder in Finder and send the zip. No cleanup needed: Shimejiko drops __MACOSX folders, .DS_Store files and ._ files on import, so a Finder zip comes in clean. It also takes rar, 7z, lzh and tar archives, and plain folders. A zip with a password makes Shimejiko ask for it; a password-protected RAR or 7z can't be unlocked, so unpack it elsewhere and import the folder. In the version from our site, packs you import need Pro after a three-day trial.
Test the pack before you send it, or start with how to make a Shimeji if you're still drawing. Shimeji ZIP, RAR and JAR files compares the archive types.

In this app recording, Shimejiko holds a box in the drop zone and a new friend pops out. It shows a pack arriving, not a zip being made. The Finder steps follow Apple's macOS 27 guide and weren't tried on a Mac for this article; the Terminal findings come from our own test runs.

