How to password-protect a ZIP file on Mac

485.6K views
9 min read

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.

  1. Open Terminal on your Mac.
  2. 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.
  3. 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)!
  4. Type the password for your archive, confirm it, and press Enter. When you type the password, no characters are displayed – this is normal.
  5. Wait for the process to finish. You'll find the new ZIP in the same folder as the original file.

terminal password protecting zip 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:

  1. Download and open Archiver.
  2. Drag the folder or file you want to zip into the app window.
  3. Click Archive.
  4. Select the compression format and compression level.
  5. Check the Encrypt box and create and confirm a password.
  6. Click Archive again.

archiver setting password on zip file

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.

betterzip setting master password

Step 2. Set the password for future archives.

  1. In the Settings, go to the Presets section.
  2. Switch to the Save tab and select Clean and Zip.
  3. Select the encryption Method. I recommend that you choose Strong (AES-256).
  4. 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.
  5. Close the Settings.
betterzip setting passwords for zip files

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.

  1. Open Terminal on your Mac.
  2. 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.
  3. 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.
  4. 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.
  5. Wait for the process to finish. Your files will be extracted to the current directory.

terminal unzipping protected archive

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:

  1. Open BetterZip on your Mac.
  2. Drag and drop the zipped file you want to view or edit (or find it in the left menu in BetterZip).
  3. 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.
  4. If edits were made, select "Save" at the top left of the BetterZip window to re-save the compressed file or folder.

betterzip editing files without unzipping

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?

To password-protect a ZIP folder, open Terminal, go 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.

Why can't I password-protect a ZIP file on a Mac?

You can't password-protect a ZIP file on a Mac because the built-in Archive Utility does not offer such an option. Instead, you need to use the Terminal and the zip command. For a more straightforward process and more convenience, use BetterZip or Archiver.

250+ apps for $9.99
per month

Sign up to Setapp and try them for free.

Security-tested