How to password-protect a ZIP file on Mac
Let me put it straight: your Mac doesn’t have a built-in, easy way to set a password for a ZIP archive. You’ll either need to fiddle with Terminal (which is free) or use a third-party app (which is faster but may cost some money).
As for me, I’ve been using the second option — quick and painless — for several years now. But before that, Terminal was my go-to tool. So, yes, I know both pretty well. Let me show you how to password-protect a ZIP file and share with you the tools I find best.
Ways to secure ZIP files | How to do it |
Use Terminal | Open Terminal on your Mac. Type: zip -er YourZipFileName.zip (your desired file name) > Drag and drop files to compress > Press Enter > Type a password > Enter. |
Core Shell | Install Core Shell to switch between many hosts. This is a full-featured SHH terminal with a one-click login to zip files securely. |
Archiver | Install Archiver to compress files with a password. Open the app > Drag a file to zip > Click Archive > Choose format > Select Encrypt > Create password > Archive. |
BetterZip | Install BetterZip to create archives of popular formats. Step 1. Open the app > Set up the Master Password. Step 2. Go to Settings > Presets > Save > Click Set next to the Password line > Set password. BetterZip will use this password for future ZIP files. |
How to create a ZIP file on a Mac
Let's start with the basics. Your Mac can create and extract ZIP archives by default. Here's how to zip files.
- For a single file or folder. Right-click the file you want to zip and choose Compress from the drop-down menu. Instead of right-clicking, you can press the Control key and click to open the drop-down menu.
- For multiple files or folders. Select the necessary files with the mouse or click them one by one while holding down the Command key. Then right-click to open the drop-down menu and select Compress. All selected files will be compressed into a single archive.
And there you have it!
3 ways to password-protect ZIP on Mac
Let's move on to a more difficult task and learn how to password-protect ZIP files.
#1. How to password-protect a ZIP file with Terminal
The only native way to password-protect an archive on a Mac is through the Terminal. These instructions might seem daunting, but if you follow them closely and copy the commands carefully, I promise you’ll be fine.
- Open Terminal on your Mac.
- Type in cd and the location of the file or folder you want to compress and protect. In my case, it's the Desktop, but your file could be anywhere else: Downloads, Applications, etc. So, as you can see in the picture below, I typed cd desktop.
- Type this command into Terminal: zip -e -r New File.zip Original File
- New File.zip is the name of the file you want to receive. In my case, it is "Setapp_protected.zip".
- Original File is the full name of the ZIP file you want to password-protect. Mine was "Setapp.zip". Note that you should also write the extension (.zip)!
- Type the password for your archive, confirm it, and press Enter. When you type the password, no characters are displayed – this is normal.
- Wait for the process to finish. You'll find the new ZIP in the same folder as the original file.
You're done! Remember your password because there's no "forgot password" option here. This method has the right to live if you need to encrypt one or two archives. But if you have a lot of files and protecting them is your routine, there are better ways to go than the Terminal.
#2. How to create encrypted archives on a Mac in seconds with Archiver
When it comes to third-party archive protection tools, Archiver is probably the fastest and the easiest, and definitely one of my favorites.
Here's how to password-protect a ZIP file on a Mac using Archiver:
- Download and open Archiver.
- Drag the folder or file you want to zip into the app window.
- Click Archive.
- Select the compression format and compression level.
- Check the Encrypt box and create and confirm a password.
- Click Archive again.
Be sure to memorize your password or store it in a safe place. You'll have to type it each time you open the archive, even if you work on the same computer you used for encryption.
#3. The easiest way to protect ZIP files on your Mac with BetterZip
If you need a more advanced tool for frequent work with archives, I highly recommend BetterZip as the best choice. First, it's easy: drag and drop, and the file is archived and password-protected. Second, it is secure. It automatically protects your files and folders with AES-256 encryption (also called "military-grade protection") and has a password generator for creating and managing strong passwords for files or folders.
I must admit: you'll need to configure a few settings first, and it may take some time. But I promise that after that, zipping, encrypting, and opening archives will always be a breeze.
Step 1. After downloading and opening BetterZip, click BetterZip > Settings > Passwords in the top menu. Set up the Master Password in the lower left corner. This will allow you to customize your passwords further.
Step 2. Set the password for future archives.
- In the Settings, go to the Presets section.
- Switch to the Save tab and select Clean and Zip.
- Select the encryption Method. I recommend that you choose Strong (AES-256).
- Click the Set button next to the Password line and set a password. You can enter it manually or generate it by clicking the key icon. Remember the password. BetterZip will apply it to all subsequent ZIP files you create until you set a new one.
- Close the Settings.
The app is now ready to use. To password-protect ZIP on Mac, drag the file or folder into the BetterZip window and click Save. The new protected archive will appear next to the original file or folder.
Both you and the person you share the archive with must enter a password to open it. But what if you don't want to type passwords every time and also don't want to unprotect your ZIP file? There is a solution.
Return to Settings > Passwords and check the box "Add all entered passwords to this list." From the drop-down menu, choose what the password manager should do. I recommend selecting the "Automatically try passwords except for RAR archives" option.
Now, you don't need to type anything. BetterZip will automatically choose the password from the saved ones when you open the archive. However, unauthorized people will still need to type in the password.
How to open a password-protected file on a Mac
The easiest way to open an encrypted ZIP is to double-click it and enter the password. Archive Utility (a native Mac tool) will open and unpack your file.
The other way is to use the Terminal.
- Open Terminal on your Mac.
- Use the cd command to change directories to where your ZIP file is located. For example, if it's on your Desktop, you would use cd desktop.
- Type the following command, replacing YourFile.zip with the name of your ZIP file: unzip YourFile.zip. In my case, the command is unzip tickets.zip.
- Type in the password for the ZIP file and press Enter. Note that any characters won't show on the screen; this is normal for password prompts in Terminal.
- Wait for the process to finish. Your files will be extracted to the current directory.
The disadvantage of the Mac's native tools is that opening them equals unpacking them. Once you open the archive, a folder containing the unzipped files is created on your Mac. You won't be able to preview or edit the files inside the ZIP.
If you want to manage the files inside the archive, extract individual files without unzipping them, etc., you'll need third-party apps. I recommend BetterZip to open encrypted ZIPs. Here's how it works:
- Open BetterZip on your Mac.
- Drag and drop the zipped file you want to view or edit (or find it in the left menu in BetterZip).
- If you're viewing files, double-click the file in the compressed folder to view. If you are making edits, like changing the filename, make any edits you like.
- If edits were made, select "Save" at the top left of the BetterZip window to re-save the compressed file or folder.
As long as you use BetterZip, you can perform many actions without breaking the compression.
Final thoughts on opening ZIP with a password on Mac
Let's sum up. Unfortunately, the Mac's built-in tools don't provide an easy way to set and remove a password from the ZIP archive. You can use the Terminal to encrypt and decrypt the archive. But the process is tedious, so it's unsuitable for regular tasks. Archive Utility (the native Mac app) only allows you to remove passwords, not set them.
If you regularly work with password-protected archives, I recommend you to use BetterZip and Archiver. They protect files securely and allow you to edit them inside the archive, retrieve individual files without unzipping the entire archive, and so on.
Both BetterZip and Archiver are free during a seven-day trial of Setapp, a suite of productivity apps for the Mac. In addition to these two great tools, you'll gain unlimited access to the entire Setapp catalog of nearly 250 amazing Mac apps.
FAQ
How do I password-protect a ZIP folder?
Use the Terminal to password-protect the archive on a Mac. Open Terminal, navigate to your folder's location with cd, then run zip -er YourZipName.zip FolderName. Enter and verify your password when prompted.
For a more straightforward process, better protection, and more convenience, use the BetterZip and Archiver apps.
Why won't my protected ZIP file open?
If your password-protected ZIP file won't open, it might be due to an incorrect password, unsupported encryption by the Archive Utility on Mac, a corrupted ZIP file, outdated or incompatible unzipping software, or insufficient file permissions. Try using a different app like BetterZip or Archiver, check for software updates, or ensure you have the correct file permissions.