Skip to content
Aback ZIP

How-to · 6 min read · Updated

Zip a folder on Mac

Compress a folder on macOS with Finder, Terminal or your browser. Keep folder structure, avoid __MACOSX clutter and add a password when needed.

The quickest way to zip a folder on a Mac is to select it in Finder and choose Compress. That produces a single ZIP with the folder intact inside it. Finder also tends to add hidden macOS metadata, which is harmless on a Mac but annoying on Windows and Linux. If you want a clean archive, a password, or control over what goes in, Create ZIP builds the archive in your browser while preserving relative paths. This guide covers all three approaches.

Zip a folder with Finder

  1. Open Finder and navigate to the folder you want to pack. You can select several folders or a mix of files and folders if you prefer.
  2. Control-click the selection (or right-click with a mouse) and choose Compress. Apple documents this in its guide to compressing and decompressing files on Mac.
  3. Finder writes a ZIP next to the original. A single item produces Folder.zip; several items produce Archive.zip. Wait for the progress indicator to finish before moving the file.
  4. Double-click the ZIP to check it. Archive Utility expands it into a folder beside the archive. On a Mac, everything looks exactly as it went in.
  5. Send the ZIP, or keep it as a compact copy. The original folder is never changed or removed.

Finder ZIPs often contain a __MACOSX folder and .DS_Store files. They carry Finder view settings and icon data. Windows and Linux users see them as junk, and people who unzip into the wrong place can end up with an extra folder level.

Remove the macOS metadata

The metadata Finder adds is not dangerous, but it makes an archive messier and slightly larger. You can strip it after creating the ZIP with Clean ZIP, which removes __MACOSX, .DS_Store, ._ AppleDouble files and custom patterns of your own. It shows a preview first, so you can see exactly what will be dropped. The same tool can remove Windows Thumbs.db and desktop.ini too.

If the archive is for someone on another platform, this cleanup is worth doing. For the full explanation of why those files appear and what they contain, see how to remove __MACOSX and .DS_Store from a ZIP. If file names look wrong after the archive crosses systems, the cause is usually encoding rather than metadata; why ZIP file names are garbled explains that separately.

Zip a folder from Terminal

macOS ships with Info-ZIP's zip command, which gives you more control than Finder and does not add __MACOSX folders. Open Terminal in the folder's parent directory and run:

zip -r project.zip project/

The -r flag recurses into subfolders, and the trailing path keeps project/ as the top-level folder inside the archive. Add -9 for the strongest Deflate compression or -0 to store files without compression, which is faster and better for photos and videos. To include hidden files such as dotfiles, use zip -r archive.zip folder/ .[^.]* ..?* from inside the folder, or use ditto:

ditto -c -k --sequesterRsrc --keepParent project project.zip

ditto is Apple's own archiving tool. --sequesterRsrc stores resource forks in a __MACOSX folder for compatibility, while --keepParent keeps the folder name as the top level. Drop --sequesterRsrc if you do not need Mac-specific metadata. List the result with unzip -l project.zip to confirm the structure before sending it.

Zip a folder in the browser

  1. Open Create ZIP and drag the folder onto the page, or use the choose button and select it in the macOS file dialog.
  2. The tool records each file's relative path, so a file at project/src/app.ts keeps that path in the archive. Empty subfolders get their own entries and survive the round trip.
  3. Review the list. Rename or remove individual files if needed, and add more files from elsewhere if the collection is not complete.
  4. Choose Store, Fast, Balanced or Maximum compression. With the default smart behaviour, formats that are already compressed, such as JPEG, MP4 and DOCX, are stored as they are rather than being worked over for no gain.
  5. Optionally add an AES-256 password, name the archive and create it. The work happens in a background Web Worker on your Mac; the files are not uploaded.
  6. Download the finished ZIP when it is ready. If you expect size to be a problem, check what can actually be saved before sending.

Add a password when the contents are sensitive

Neither Finder's Compress command nor plain zip -r encrypts anything. For a password, use Password Protect ZIP after creating the archive, or set one directly in Create ZIP. AES-256 is the strong option, but the recipient needs a modern extractor such as 7-Zip, Keka or Extract ZIP. Traditional ZipCrypto opens in more places, including Windows File Explorer, but it is weak against a determined attacker; the differences are set out in AES vs ZipCrypto.

Send the password by a separate channel from the archive. A password in the same email as the attachment defeats most of the point of encrypting it.

Keep the archive small and compatible

Before you send a Mac ZIP to someone else, think about what they will open it with. Windows File Explorer reads ordinary Deflate ZIPs without a problem, but it does not open AES-encrypted archives and can be confused by ZIP64 or unusual compression methods. Keeping paths short helps too: some Windows tools still fail on paths longer than about 260 characters, especially when an archive unwinds into a deeply nested source tree.

  • Avoid file names containing characters Windows forbids, such as a colon, asterisk, question mark or angle bracket, if the archive is going to a mixed group.
  • Skip resource forks and Finder view settings unless the recipient also uses a Mac; they add bytes and create the __MACOSX folder.
  • If the ZIP will travel by email, compare its size with the provider's limit before you compose the message.
  • For a final check, open the archive in ZIP Viewer and confirm the entry count, compression methods and encryption flag are what you intended.
  • Keep the original folder until the recipient confirms the archive opened correctly; the ZIP is a copy, not a replacement.

Which method should you use

MethodFolder structureMetadataPasswordBest for
Finder CompressPreservedAdds __MACOSX and .DS_StoreNoA quick ZIP for another Mac
zip -r in TerminalPreservedMinimalOptional via -P or -eClean archives for mixed platforms
dittoPreserved with --keepParentMac resource forks if requestedNoArchives that need Mac-specific attributes
Create ZIP in the browserPreserved, including empty foldersUTF-8 names and extended timestampsAES-256 or ZipCryptoSharing with control, no junk files

Tools for this

Frequently asked questions

Control-click the folder in Finder and choose Compress. A ZIP appears next to the original with the folder inside it. Use Clean ZIP afterwards if you want to remove macOS metadata.

More guides