Links on Android Authority may earn us a commission. Learn more.
How to password protect a zip or rar file
Zip and rar files are a great way to send someone a folder by email or the cloud or if you’re putting them away in long-term storage. A zip or rar file compresses and stores them neatly and tidily until the next time you need them. But some of those files may be sensitive and confidential. How do you ensure that the wrong sets of eyes don’t look at them? Here’s how to password-protect a zip or rar file on both Windows and Mac.
Read more: 5 best zip, rar, and unzip apps for Android
QUICK ANSWER
To password-protect a zip file on Windows, you can use the integrated option if you have Windows Pro. If not, WinZip or 7Zip are your choices. For a zip file on Mac, you need to use the Terminal window.
JUMP TO KEY SECTIONS
How to password-protect zip files
You have three options on Windows for putting passwords on zip files and only one method on Mac.
Windows 11 Pro built-in option
If your version of Windows is the Pro edition, then there is a built-in way to password-protect a zip file. Unfortunately, this does not work on the Home edition.
Right-click on the zip file and select Properties.

Under Attributes, click Advanced.

There is an option called Encrypt contents to secure data. However, since this is Windows 11 Home Edition, the option is greyed out. If you have the Pro edition, click Details to enter your password.

Windows 11 – WinZip
WinZip is a very popular zipping software tool, but it isn’t free. So if you’re looking for a free way to password-protect a zip file, WinZip only gives you a 21-day free trial before you have to pay $34.95. We’ll be looking at a completely free option in the next section, but if you already have WinZip on your computer, it’s worth going over how to use it to add a password to a zip file.
Open the Zip file in WinZip and go to Tools. Click Encrypt.

You will be asked to enter your password into the box provided. The password must be at least eight characters long. There is no lost password retrieval option, so if you lose the password, you’ve lost the files. However, on the other hand, don’t make the password too simple to figure out. Click OK afterward.

You’ll now see padlock icons next to each file, indicating they are now locked by the password. Close the zip file to complete the encryption process.

Now when the zip file is opened again, a password prompt will immediately appear in order to unlock the files.

Windows 11 – 7Zip
If you don’t have WinZip on your computer and you’re unwilling or unable to pay $34.95 for it, a free open-source option is 7Zip. It only works on Windows, but it is also possible to port it to Linux if you have the technical know-how.
Right-click on the files you want to compress and choose 7-Zip > Add to archive.

In the box that now pops up, look to the right, and you’ll see the Encryption section. Enter your desired password. You don’t have to change the encryption method — AES-256 is more than sufficient. Now, click OK and close the box.

The archive will now be made with a 7z file format. When you open it, you will now be prompted for a password.

Mac
WinZip is also available for Mac, and there is also another encryption method built right into Mac. But that uses the DMG format, not Zip. If you’re determined to stay with Zip, then some work with the Terminal is involved.
Right-click on the files and select Compress.

Once your Zip file has been made, move it to the desktop. Now, open Terminal and type:
cd desktop
Hit Enter and then type the following, obviously replacing NAMEOFFILE with the name of your Zip file.
zip -er NAMEOFFILE.zip NAMEOFFILE

You’ll be asked to enter a password. Note that the cursor won’t move when you’re typing it. After hitting Enter, you’ll be asked to type the password in again to verify it. Hit Enter once more, and the zip file is now password-protected.

How to password-protect RAR files
Things start to get a bit more complicated when it comes to rar files, and if you’re on a Mac, it’s best to forget rar files altogether.
Windows 11 (WinRAR)
If you would like a free method to password-protect a rar file, then 7Zip is the best option. Simply repeat the process shown previously for using 7Zip to password-protect a zip file. It’s the same procedure for rar files.
The main player, though, for handling rar files is definitely WinRAR. Like WinZip, WinRAR is not free. It’s $30 per user, but it does come with a generous 40-day trial period.
Right-click on the files you want to turn into a rar file and choose WinRAR from the Windows menu. You’ll now see this box. Under General, look for Lock Archive and Set password.

After clicking Set password, add your password and again to confirm. Click OK to finish the encryption process.

Mac
There doesn’t seem to be any good way for a Mac user to password-protect a RAR file. You can open RAR files with The Unarchiver, but it doesn’t seem possible to add a password to them on Mac devices. You’re much better off staying with Zip files.
Read more: How to zip or unzip files on a Chromebook
FAQs
No, there is no password retrieval option.
The major problems usually accept up to 130 characters. However, realistically, you should keep it to 20 characters or under.
127 characters. So pretty much the same as Zip files.
It’s as secure as the password you give it. However, if you’re talking about the strength of the encryption standard, AES-256 is military-grade encryption. So yes, it’s secure.
If you only want to open the file (and not add a password), you can use 7Zip and WinZip on Windows. On Mac, you can use The Unarchiver.