How to Password Protect a Folder on Windows and Mac

How to Password Protect a Folder on Windows and Mac

Want to know how to password protect a folder on Windows or a Mac? Start with an honest truth: neither system has a simple “put a password on this folder” button. Windows File Explorer doesn’t offer one, and neither does the Finder on macOS.

What both systems do have is encryption. Instead of locking the folder where it sits, you put its contents inside something that only opens with a password: an encrypted archive, an encrypted disk image or an encrypted drive. Pick the method that fits you below, then follow its steps.

How to password protect a folder: pick your method

Method Windows or Mac Cost How strong Best for
7-Zip encrypted archive Windows Free Strong (AES-256) with a good password Sending or storing a folder that rarely changes
EFS (“Encrypt contents”) Windows Pro, Enterprise, Education Included Strong, but opens for anyone signed in as you Keeping files away from other accounts on the same PC
BitLocker encrypted VHD or BitLocker To Go Windows Pro, Enterprise, Education Included Strong (AES) A private “drive” on your PC, or a USB stick
Encrypted disk image (.dmg) Mac Free, built in Strong (128- or 256-bit AES) Most Mac users
VeraCrypt container Windows and Mac Free, open source Strong One locked container that works on both systems

Every method here is only as strong as the password you choose. A long passphrase of four or five random words beats a short word with symbols swapped in, as our summary of NIST’s password guidance explains.

Step by step

On Windows

Method 1: an encrypted archive with 7-Zip

7-Zip is a free, well-known archiving tool. It can pack a folder into a single file locked with AES-256, and it works on every edition of Windows, including Home.

  1. Install 7-Zip from its official website.
  2. Right-click the folder. On Windows 11 you may need Show more options first, depending on your 7-Zip version.
  3. Choose 7-Zip, then Add to archive.
  4. Set Archive format to 7z (or zip if the other person can’t open 7z files).
  5. Under Encryption, type your password twice and check that the method says AES-256.
  6. For 7z files, tick Encrypt file names, so nobody can even see what’s inside.
  7. Click OK, then open the new archive once to check the password works.
  8. Delete the original, unencrypted folder, and empty the Recycle Bin.

The catch: the archive is a snapshot. To change a file you extract it, edit it and pack it again. Windows’ own “Compressed (zipped) folder” option can’t add a password at all.

Method 2: EFS, “Encrypt contents to secure data”

Windows Pro, Enterprise and Education include the Encrypting File System (EFS). Right-click the folder, choose Properties, click Advanced on the General tab, tick Encrypt contents to secure data and click OK twice. On Windows Home the box is greyed out or missing.

Know what EFS actually does. There is no separate folder password: the files are tied to your Windows account. Anyone signed in as you opens them normally, while other accounts on the PC, or someone who pulls out the drive, can’t. So it protects you from other users, not from someone who knows your Windows password.

Back up your encryption certificate. Windows usually offers this right after you encrypt something (“Back up your file encryption key”). If you skip it and your account or Windows install is lost, the files can stay locked for good. Keep the backup file and its password somewhere safe, away from the PC.

Method 3: BitLocker, an encrypted VHD or BitLocker To Go

BitLocker encrypts whole drives, but you can give it a small “drive” of its own. In Disk Management, choose Action, then Create VHD, pick a size and a place to save it, then initialise and format the new disk. Right-click it in File Explorer, choose Turn on BitLocker and pick Use a password to unlock the drive. You now have a locked drive you can open, use like any folder, and eject.

For a USB stick, BitLocker To Go works the same way: right-click the stick and turn on BitLocker with a password. Save the recovery key it gives you somewhere other than the stick.

BitLocker’s management tools need Pro, Enterprise or Education. Windows Home often has Device Encryption instead, which protects the whole drive on supported hardware if the laptop is stolen. It can’t lock a single folder with its own password. Menu names have moved between Windows versions, so if you can’t find an option, search Settings for “BitLocker” or “Device encryption”.

On a Mac

Method 4: an encrypted disk image with Disk Utility

This is the closest thing macOS has to a password-protected folder, and it’s built in.

  1. Open Disk Utility (in Applications, then Utilities, or search with Spotlight).
  2. From the menu bar, choose File, then New Image, then Image from Folder.
  3. Pick the folder you want to protect and click Choose.
  4. Give the image a name and choose where to save it.
  5. Next to Encryption, choose 128-bit AES or 256-bit AES. 256-bit is a little slower and a little stronger; both are fine for personal files.
  6. Type your password twice when asked.
  7. Set Image Format to read/write if you want to add or change files later. The other formats are read-only.
  8. Click Save and wait for it to finish.
  9. Double-click the new .dmg file and enter the password to check it opens.
  10. Delete the original folder and empty the Trash.

When you open the image, macOS may offer to remember the password in your keychain. Leave that unticked if other people use your Mac account, or anyone at the keyboard can open it with no password. Eject the image when you’re done, and it’s locked again. Wording can differ slightly between macOS versions, but these menus have been in Disk Utility for many years.

On Windows and Mac

Method 5: a VeraCrypt container

VeraCrypt is free, open-source encryption software. It creates a single file, called a container, that appears as a separate drive once you enter the password. Put your private files in it, dismount it, and it’s locked. Because the same container opens on Windows and macOS, it suits people who move between both or keep files on a shared external drive.

It takes a few more clicks than the built-in options, and on a Mac it needs an extra component installed first. Download it only from its official website.

Hidden folders and “lock folder” .bat tricks are not protection. Marking a folder as hidden only stops it showing in File Explorer or Finder; one setting brings it back. The popular batch-file tricks that rename a folder and ask for a “password” store that password in plain text inside the script, and they never encrypt anything. Anyone who opens the .bat file in Notepad, or browses the folder from another tool, sees everything.

The same goes for free “folder lock” apps that only hide files. If an app doesn’t say it encrypts the files, treat it as a curtain, not a lock.

A few common questions

Can I password protect a folder in OneDrive or Google Drive?

Not with a folder password. OneDrive has a Personal Vault that asks you to verify your identity again before opening it, though the free plan limits how much you can keep there. Google Drive has nothing similar. For either service, the reliable route is to encrypt the folder first (a 7-Zip archive, a .dmg or a VeraCrypt container) and upload that file.

What if I forget the folder password?

With real encryption, there is no “reset” link. That’s the whole point: if the password could be bypassed, so could a thief’s attempt. A forgotten 7-Zip, disk image or VeraCrypt password usually means the files are gone. Only BitLocker gives you a recovery key, and only if you saved it.

How do I keep files private on a shared family PC?

Give each person their own Windows or Mac user account first. That alone keeps most files apart. Then use an encrypted archive, disk image or container for anything sensitive, and don’t let the system remember its password.

Keeping the folder password safe

All of these methods move the problem to one place: the password. Write it on a sticky note and anyone can open the folder; forget it and nobody can, including you. A password manager solves both sides, and it’s a safer place than your browser’s notes or a text file on the desktop.

In PassHulk you can save the folder’s password as a secure note or a login, and attach the BitLocker recovery key or the EFS certificate backup to the same item. Everything is encrypted on your device before it’s synced, so PassHulk’s servers only hold locked data. The built-in generator can make a long passphrase for the folder, too. The features page shows what else it keeps.

Don’t wait for the next leak. Get every password protected.

PassHulk creates a strong, unique password for every account, fills it in for you, and warns you when one turns up in a breach.

Start free trial
15 days freeNo card neededNothing charged when it ends