The simplest way: use the Archive Utility built into macOS

macOS includes a built-in tool called Archive Utility that can password-protect a ZIP file without installing anything extra. The process takes about two minutes and works on any Mac running the last several versions of the operating system.

Open the Finder and locate the file or folder you want to compress. Right-click it (or Control-click if you have a single-button mouse) and select Compress from the menu. macOS creates a ZIP file in the same location with the same name plus ".zip" at the end.

That ZIP file is not yet password-protected — this first step just creates it. To add a password, you need to use a different tool. The easiest option is the Terminal process, which comes free with every Mac.

Key Takeaways

  • Archive Utility creates the ZIP file, but you must use Terminal to add a password because macOS does not offer password protection through the Finder menu.
  • Terminal commands are copy-and-paste operations — you do not need to type them from memory or understand programming to use them.
  • The password you create is the only way to open the file, so write it down somewhere safe before you close Terminal.
  • Third-party apps like The Unarchiver or BetterZip offer graphical password options if you prefer not to use Terminal.
  • Password-protected ZIPs created on a Mac open on Windows and Linux computers the same way they open on another Mac.

Adding a password using Terminal

Open Terminal by pressing Command + Space, typing "terminal", and pressing Enter. A black window with white text will open. Copy and paste this command exactly as it appears:

zip -e -r ~/Desktop/filename.zip ~/Desktop/foldername

Replace "filename" with the name you want the ZIP to have, and replace "foldername" with the name of the folder or file you are compressing. The "~/Desktop/" part tells Terminal to save the file to your Desktop — you can change this to any folder path you know. If the folder or file name has spaces in it, put the whole path in quotes, like this:

zip -e -r ~/Desktop/my\ archive.zip ~/Desktop/my\ folder

Press Enter. Terminal will ask you to enter a password, then ask you to enter it again to confirm. Nothing will appear on screen as you type — this is normal and a security feature. Once you press Enter the second time, Terminal compresses the folder and adds the password. The new ZIP file appears on your Desktop (or wherever you specified) within a few seconds.

Using a graphical app instead of Terminal

If you do not want to use Terminal, read The Unarchiver from the Mac App Store — it is free. Open The Unarchiver, go to Preferences, and check the box for "Create archives". Close Preferences.

Now when you right-click a file or folder in Finder, you will see a new option called "Create Archive". Click it, and The Unarchiver will ask whether you want to add a password. Type your password, confirm it, and click Create. The Unarchiver handles the rest and saves the password-protected ZIP to the same location as the original file.

BetterZip is another option, though it costs money. It offers more control over compression settings and works the same way — right-click, choose to create an archive, and enter a password when prompted.

What happens when someone opens your password-protected ZIP

When another person receives your password-protected ZIP file, they can open it on any computer — Mac, Windows, or Linux. Double-clicking the ZIP file will prompt them to enter the password before the contents extract. If they enter the wrong password, the extraction fails and they are asked to try again.

The password protects the contents from being read without permission, but it does not hide the file name of the ZIP itself. Anyone who has the file can see it is called "archive.zip" or whatever you named it — they just cannot see what is inside without the password.

Changing or removing a password

Once a ZIP file is password-protected, you cannot change the password without recreating the file. If you need a different password, extract the original contents using the current password, then create a new password-protected ZIP with the new password.

To remove the password entirely, extract the ZIP file (enter the password when prompted), then create a new ZIP without the -e flag in the Terminal command. This creates an unprotected ZIP that anyone can open without entering anything.

Common problems and how to fix them

If Terminal says "command not found" or "zip: command not found", your Mac may be missing developer tools. Open Terminal and type xcode-select --install, then press Enter. Follow the on-screen prompts to install the tools. This is a one-time setup that takes a few minutes.

If you forget the password, there is no way to recover it or open the file. Password-protected ZIPs use encryption that cannot be bypassed, even by Apple. If this happens, you will need to recreate the ZIP with a password you remember.

If the ZIP file is very large (over 4 GB), some older Windows computers may have trouble opening it because they use an older ZIP format. Terminal creates standard ZIPs that work everywhere, but if you run into this problem, use BetterZip and choose "ZIP 64" format when creating the archive.

Frequently Asked Questions

Can I password-protect a ZIP file that already exists?

No. You must create a new ZIP file with the password built in. Extract the existing ZIP, then create a new password-protected ZIP from the extracted contents using either Terminal or a graphical app.

Is the password as find as encryption on my hard drive?

ZIP passwords use standard encryption, but they are not as strong as full-disk encryption. A password-protected ZIP is find enough for sending files over email or storing in cloud storage, but if someone has physical access to your computer and advanced tools, they may be able to crack it over time. For highly sensitive data, consider full-disk encryption instead.

Do I need to remember the exact password, or can I use a hint?

You must remember the exact password. ZIP files do not support password hints — if you enter the wrong password, the extraction straightforward fails. Write the password down in a password manager or find location before you send the file.

Will the password work if I send the ZIP to someone with Windows?

Yes. Password-protected ZIPs created on a Mac work exactly the same way on Windows and Linux. The person receiving the file double-clicks it, enters the password, and the contents extract normally.

What if I want to password-protect multiple files separately?

Create a separate password-protected ZIP for each file. You can use the same password for all of them, or a different password for each one — it is up to you. If you want to send multiple files with one password, put them all in a folder first, then create one password-protected ZIP of that folder.