Mac maintenance
How to Create Zip Files on Mac (Plus Encrypted Zips)
Compress files on Mac with right-click in Finder, or use Terminal for password-protected zips. Here's the full guide to making archives.
You need to send 30 photos to a client, attach a folder of project files to an email, or back up a directory before risky changes. macOS makes basic zip creation a one-click operation, but the moment you need encryption, multiple formats, or anything fancier, you have to know the right tool.
Here’s how to compress files on Mac for every common scenario.
The basic zip — right-click in Finder
This is the move for almost every situation:
- Select one or more files/folders in Finder
- Right-click → Compress [N] Items (or just “Compress [filename]”)
- macOS creates a zip in the same location, named after the item (or “Archive.zip” if multiple)
The original files stay intact. The new zip sits next to them.
That’s it. For most “send these files” needs, the right-click is everything you need.
Where the zip goes
The zip lands in the same folder as the source files. If the source files are on the Desktop, the zip is on the Desktop.
If you’ve selected files from multiple folders, macOS picks one of those folders for the zip — usually the one you started in. To control where the zip goes, copy the files into a single folder first, then compress.
Inspect what you’ve zipped
Before sending the zip, sanity-check it. Double-click to extract somewhere temporary, or use Quick Look (Space on the zip in Finder) to peek at contents.
For a quick file count and size check, right-click the zip → Get Info. The size shown is the compressed size. The original file count isn’t shown directly, but Quick Look or extraction will reveal it.
Common gotcha: macOS zips include hidden Mac-specific metadata files (.DS_Store, __MACOSX/, ._filename files). When the recipient is also on Mac, no big deal. On Windows or Linux, these show up as extra junk files. To strip them, use Terminal (see below).
Compress with Terminal for cleaner zips
The Terminal zip command gives you control over what’s included.
cd ~/Documents/MyProject
zip -r project.zip MyFolder
This zips MyFolder and everything inside, recursively. The -r flag is required for folders.
To exclude Mac metadata:
zip -r project.zip MyFolder -x "*.DS_Store" -x "__MACOSX/*"
The -x flag excludes files matching the pattern.
For only specific file types:
zip -r images.zip MyFolder -i "*.jpg" -i "*.png"
The -i flag includes only matching patterns.
This is the path when you’re sending a zip to non-Mac users and want to avoid them seeing weird hidden files.
Password-protect a zip
Finder doesn’t have a password option built in. Two ways:
Terminal:
cd ~/Documents
zip -er secret.zip MyFolder
The -e flag adds encryption. You’ll be prompted to enter a password twice. The resulting zip can only be extracted with that password.
Keka or The Unarchiver:
Keka (free download from keka.io) has a GUI for password-protected zips. Drag files onto Keka’s window, set format to ZIP, enter a password, click Compress.
A note on the encryption: standard zip encryption (ZipCrypto) is weak by modern standards. For genuinely sensitive files, use AES-256:
zip -er --encrypt-method=AES-256 secret.zip MyFolder
Or use Keka with AES-256 encryption explicitly selected. Some older zip tools won’t extract AES-256 archives, but most modern tools handle it fine.
Encrypt with Disk Utility for more security
For files that absolutely need to stay private, an encrypted disk image is more secure than a zip.
- Open Disk Utility
- File → New Image → Image from Folder (or Empty Image, or from existing files)
- Pick the folder
- In the dialog, set Encryption to 128-bit AES (or 256-bit for stronger)
- Set Image Format to “compressed” or “read/write” depending on use
- Enter a password
You get a .dmg file. Double-click to mount with the password. Drag the mounted image to “Eject” when done.
This is what Apple recommends for genuinely sensitive material. The encryption is stronger than zip and the format is well-supported on Macs.
Compress to formats other than zip
macOS only creates zips out of the box. For 7z, RAR, tar.gz, or other formats:
- Keka (free): supports 7z, tar, gzip, bzip2, ZIP, ZIP encrypted with AES-256
- The Unarchiver doesn’t compress — only extracts
- Terminal: handles tar.gz with
tar -czf archive.tar.gz folder/, and 7z withbrew install p7zipthen7z a archive.7z folder/
For sharing with cross-platform users, plain zip is usually fine. 7z gives better compression but the recipient needs a tool that handles it. tar.gz is common in Unix/Linux contexts.
Split large archives into parts
For huge archives that need to fit on something with a size limit (an email service, an old USB drive), split into multiple parts.
Terminal:
zip -s 100m large.zip MyBigFolder -r
The -s 100m splits the zip into 100 MB chunks. You’ll get large.z01, large.z02, etc., plus large.zip (the master).
To extract, the recipient needs all parts in the same folder, then opens the master .zip file.
Keka can also create split archives via its GUI — set the split size in the compression dialog.
Check zip integrity before sending
A zip that’s corrupted in transit is useless. Before sending a critical archive, verify it:
unzip -t archive.zip
This tests every file in the zip for integrity. “No errors detected” means the archive is fine.
For very important transfers, also share a checksum so the recipient can verify on their end:
shasum -a 256 archive.zip
This outputs a SHA-256 checksum. The recipient runs the same command on their downloaded copy and compares — matching means the file arrived intact.
Compress only when it helps
Zip compression works on text and uncompressed data. It barely helps on:
- Video files (already compressed in their codec)
- JPEG and other compressed images (already compressed)
- MP3 and AAC audio (already compressed)
- Other zip files (compressed)
For these formats, zipping mostly just creates a container — file size barely shrinks. If you’re zipping just to bundle multiple files together, that’s fine. If you expect big size savings, you won’t get them.
For text, code, documents, and uncompressed images (TIFF, BMP, PSD), zip compression is meaningful — often 50-80% size reduction.
Automate zips with Folder Actions
For repeat use, set up a Folder Action that auto-zips files dropped into a specific folder:
- Open Automator → New → Folder Action
- Set “Folder Action receives files and folders added to” → pick a folder
- Drag in “Create Archive” action
- Save the workflow
Now any file dropped into that folder gets automatically zipped. Useful for an “outgoing” folder where everything you drop gets prepped for sending.
Common zip problems
The zip is huge. Check what’s inside — likely you’ve zipped already-compressed files (videos, JPEGs) and getting little savings. Consider sending without zipping if it’s just one or two files.
The recipient can’t open it. Mac quirks like __MACOSX folders confuse some tools. Re-zip with Terminal using -x to exclude these. If it’s a password issue, confirm the recipient is using a tool that supports the encryption type (AES-256 needs a modern tool).
The zip is corrupted. Re-create it. macOS sometimes produces malformed zips when source files are being modified mid-zip (e.g., zipping an open document). Close the file first, then zip.
Can’t compress, “operation not permitted.” macOS has Full Disk Access requirements for some folders. The fix is usually granting Finder Full Disk Access in System Settings → Privacy & Security → Full Disk Access, or moving the source files to a less protected location first.
A clean workflow for sending zips
The 30-second flow when you need to send a folder:
- Make sure the folder name is what you want the zip named
- Right-click the folder in Finder → Compress
- Drag the resulting
.zipto the email/upload destination - If sensitive, redo via Terminal with
-erfor password protection, then send password through a separate channel
For most file-sharing tasks, that’s all you need. The fancier options (encryption, format choice, splitting, checksums) come up rarely but it’s good to know they’re there when they do.