How to password-protect a ZIP file on Mac

409.8K views
7 min read

Let's be clear: your Mac doesn't have a built-in, straightforward way to set a password for the ZIP archive. You'll either have to fiddle with Terminal (which is free) or use a third-party app (which is fast but can cost some money). So, let's look at the best tools and learn how to password-protect a ZIP file.

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.

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.

  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 our case, it's the Desktop, but your file could be anywhere else: Downloads, Applications, etc.
  3. Type this command into Terminal: zip -e -r YourZipFileName.zip TheFileOrFolderYouWantToZip
    • YourZipFileName.zip is the name of the file you want to receive. In our case, it is Setapp_protected.zip.
    • TheFileOrFolderYouWantToZip is the name of the ZIP file you want to password-protect.
  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.

Create encrypted archives on a Mac in seconds

When it comes to third-party archive protection tools, Archiver is probably the fastest and the easiest.

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.

The easiest way to protect ZIP files on your Mac with BetterZip

If you need a more advanced tool for frequent work with archives, then BetterZip is 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.

You'll need to configure a few settings first, but 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. We 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

Now, the app is 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, but you 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. We 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 YourZipFileName.zip with the name of your ZIP file: unzip YourZipFileName.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. We 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
  4. If you are making edits, like changing the filename, make any edits you like.
  5. 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 functions without disturbing the compression.

Open any ZIP with a password on Mac in a breeze

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 work with password-protected archives regularly, use the third-party apps 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 prolific 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 200 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.

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

The built-in Archive Utility does not offer an option to add a password directly. Instead, you need to use the Terminal and the zip command. For a more straightforward process and more convenience, use BetterZip or Archiver.

240+ apps for $9.99
per month

Sign up to Setapp and try them for free.

Security-tested