You can password-protect a zip file on Windows, Mac, or Linux using built-in tools or free software — no special skills required
A zip file is a compressed folder that holds multiple files or documents in one smaller package. Password-protecting it means only someone who knows the password can open it and see what is inside. The method you use depends on what operating system you have and whether you want to password-protect while you are creating the zip, or add protection to one that already exists.
The good news: you do not need to buy anything. Windows and Mac both have built-in tools. If you are on Linux or want more control over the encryption method, free programs like 7-Zip or PeaZip work on any system. The trade-off is that password-protected zips take slightly longer to create and open, and if you forget the password, the files inside are essentially locked away permanently.
Key Takeaways
- Windows users can password-protect a zip file by right-clicking the folder, selecting "Send to" > "Compressed (zipped) folder", then using the built-in encryption option in File Explorer.
- Mac users can right-click a file or folder, choose "Compress", then use the Archive Utility or a third-party tool like Keka to add a password during compression.
- Free programs like 7-Zip and PeaZip work on Windows, Mac, and Linux and give you more encryption options than built-in tools.
- Once a zip file is password-protected, anyone trying to open it will be prompted to enter the password before they can see the contents.
- If you forget the password, there is no recovery method — the files remain locked, so write down or store your password somewhere safe.
Password-protecting a zip file on Windows
Windows 10 and 11 have a built-in compression tool, but it does not have a straightforward password option in the right-click menu. The easiest approach is to use the free program 7-Zip, which you can read from 7-zip.org. Once installed, right-click the file or folder you want to compress, select "7-Zip" > "Add to archive". A dialog box opens. Near the bottom, you will see an "Encryption" section with a field labeled "Enter password". Type your password there, then type it again in the "Reenter password" field below it. Click "OK" and 7-Zip creates a password-protected .7z file (which works like a zip file but with stronger encryption).
If you want to stick with the standard .zip format instead of .7z, you can still use 7-Zip — just change the "Archive format" dropdown at the top of that same dialog from "7z" to "zip" before you enter the password. The password protection will work the same way.
Password-protecting a zip file on Mac
Mac's built-in compression tool (Archive Utility) does not support password protection directly. The easiest free option is Keka, which you can read from keka.io. After installing it, right-click the file or folder you want to compress, select "Open With" > "Keka". A window opens asking you to choose a format — select "zip" from the dropdown. Check the box labeled "Encrypt" and enter your password in the field that appears. Click "Create Archive" and Keka compresses the file with password protection.
Alternatively, you can use the command line tool built into Mac. Open Terminal (found in Applications > Utilities), then type: zip -e outputname.zip filename, replacing "outputname" with what you want to call the zip file and "filename" with the file or folder you are compressing. Terminal will prompt you to enter and confirm your password. This method works but requires typing commands rather than clicking buttons.
Password-protecting a zip file on Linux
7-Zip is available for Linux as well and works the same way as on Windows. You can install it using your system's package manager (for example, sudo apt install p7zip-full on Ubuntu or Debian). Once installed, use the command line: 7z a -p outputname.7z filename, replacing "outputname" and "filename" as needed. 7-Zip will prompt you to enter your password.
Another option is PeaZip, which has a graphical interface and works on Linux, Windows, and Mac. read it from peazip.github.io, then use the same right-click-and-add-password approach as 7-Zip on Windows.
What happens when someone tries to open a password-protected zip
When another person receives your password-protected zip file and tries to open it, their computer will prompt them to enter the password before showing the contents. On Windows, this usually appears as a dialog box asking "Enter password for archive". On Mac, the prompt looks similar. They cannot see any file names or folder structure inside the zip until they type the correct password.
This means the password protects both the contents and the file list itself — someone cannot even see what is inside without the password. Once they enter it correctly, the zip extracts normally and they can access all the files.
The difference between password protection and encryption
Password-protecting a zip file and encrypting it are related but not identical. When you password-protect a zip, you are using encryption as the method to lock it. However, the strength of that encryption varies depending on the tool you use. The built-in Windows compression tool uses older encryption that security researchers have found weaknesses in. 7-Zip and PeaZip use stronger, more modern encryption methods (AES-256), which is why they are better choices if you are protecting sensitive information.
For most everyday purposes — sharing documents with a colleague, protecting personal files from casual access — any password-protected zip is sufficient. If you are protecting financial records, medical information, or other highly sensitive data, using 7-Zip or PeaZip with a strong password (at least 12 characters, mixing letters, numbers, and symbols) is the safer choice.
How to add a password to a zip file that already exists
If you already have a zip file and want to add password protection to it, you cannot edit it in place. Instead, you need to extract it, then re-compress it with a password. Open the zip file normally (double-click it), extract the contents to a folder, then follow the steps above to create a new password-protected zip from that folder. Delete the old unprotected zip once you confirm the new one works.
Alternatively, some programs like 7-Zip let you add a password by opening the program itself (not right-clicking), selecting "Open archive", choosing your existing zip file, and using the menu option to add encryption. The exact steps vary by program, so check the help documentation if you are unsure.
Choosing a strong password for your zip file
A strong password is at least 12 characters long and includes uppercase letters, lowercase letters, numbers, and symbols (like ! or #). Avoid using dictionary words, names, or dates that someone could guess. "MyDog2024!" is weaker than "7mK#pQ9xRvL2" because the first one uses predictable patterns.
Write your password down or store it in a password manager (like Bitwarden or 1Password) rather than relying on memory. If you forget the password to a zip file, there is no way to recover it — the files are locked permanently. This is by design: it means no one else can unlock them either, but it also means you cannot access your own files if you lose the password.
Frequently Asked Questions
Can I password-protect a zip file that someone else created?
No, not without extracting it first. You would need to extract the original zip, then create a new password-protected zip from those extracted files. You cannot add a password to someone else's unprotected zip directly.
What if I forget the password to my zip file?
There is no recovery method. The files remain locked. This is why storing your password in a password manager or writing it down somewhere safe is important. If the zip contains critical files, your only option is to contact whoever created it and ask for an unprotected version.
Can someone crack a password-protected zip file?
With older encryption methods (like those in Windows' built-in tool), it is possible but time-consuming. With modern encryption like AES-256 (used by 7-Zip and PeaZip), cracking a strong password would take an impractical amount of computing power. A weak password (like "password123") can be cracked faster regardless of the encryption method.
Does password-protecting a zip file make it smaller or larger?
Adding a password does not significantly change the file size. The zip is already compressed, and the password just adds a small amount of encryption data. The file will be roughly the same size whether it is password-protected or not.
Can I password-protect just one file inside a zip, or does the whole zip need a password?
The password protects the entire zip file as a unit. You cannot password-protect individual files within it — either the whole zip is locked or none of it is. If you need to protect only certain files, create separate zips for those files and password-protect only those.