Encrypt Online
Theme

Protect & Encrypt

How to Password-Protect a Folder on Windows and Mac

Put a password on a folder in Windows or macOS with an encrypted archive or disk image, check that it opens, and remove the unprotected original.

Encrypt Online Editorial Team6 min read
Encrypt Online guide cover on a sage background with the headline "Lock a folder". A folded ZIP page becomes the lock body under a small offset shackle.

Right-click a folder on Windows or Mac and you won't find a "Set password" option. Neither system can put a password on an ordinary folder. What both can do is put the folder's contents inside something that asks for a password: an encrypted archive or an encrypted disk image.

Which one to use depends on where the folder is going. A folder you keep on your own Mac has a different best answer from a folder you're about to email to someone on Windows.

In brief

On a Mac: Disk Utility turns a folder into an encrypted disk image (.dmg). It asks for the password each time you open it and behaves like a small drive while it's open.

On Windows: File Explorer can create ZIP and 7z files but can't add a password. Use 7-Zip, which is free, or Encrypt ZIP in your browser. Windows' own "Encrypt contents to secure data" option works through your Windows sign-in, not a password, and it isn't available on Windows Home.

Either way: The original folder stays readable until you delete it. Check that the protected copy opens first.

Pick the method for where the folder is going

Where the folder will live Use Opens with
On your Mac Encrypted disk image from Disk Utility macOS
On your Windows PC 7z archive with encrypted file names 7-Zip and compatible apps
With someone else, either system AES-256 ZIP from Encrypt ZIP or 7-Zip 7-Zip on Windows, Keka on Mac
The whole computer FileVault (Mac), BitLocker or Device Encryption (Windows) Your normal sign-in

Whole-disk encryption protects a lost or stolen laptop. It doesn't ask for a second password when someone uses your computer while you're signed in, so it doesn't replace a locked folder on a shared computer.

On a Mac: make an encrypted disk image

  1. Open Disk Utility from Applications > Utilities.
  2. Choose File > New Image > Image from Folder, select the folder, then click Open.
  3. Set Encryption to 256-bit AES encryption. Enter the password twice when asked.
  4. Set Image Format to read/write if you want to add files later. Choose compressed for a finished folder you only need to keep.
  5. Click Save. Disk Utility creates the .dmg next to the folder by default.
  6. Eject the new disk image if it's mounted. Then double-click the .dmg, enter the password and check your files.
  7. Delete the original folder and empty the Trash.

When you open the image, macOS offers to remember the password in your keychain. Leave that unchecked if other people use your Mac account. The image stays unlocked until you eject it, so eject it when you're done.

The same image can be made in Terminal. hdiutil asks for the new password before it writes the file:

Shell
hdiutil create -srcfolder ~/Documents/Taxes -encryption AES-256 -format UDRW -volname "Taxes" ~/Documents/Taxes-locked.dmg

Skip zip -e for anything sensitive. It uses the original ZIP password scheme, which is much weaker than AES and can be cracked with freely available tools.

On Windows: use an encrypted archive

  1. Install 7-Zip from the official site, 7-zip.org.
  2. Right-click the folder. On Windows 11, choose Show more options, then 7-Zip > Add to archive.
  3. Set Archive format to 7z.
  4. Under Encryption, enter the password twice, keep AES-256, and check Encrypt file names.
  5. Click OK, then open the new .7z file. It should ask for the password before showing anything.
  6. Delete the original folder and empty the Recycle Bin.

Encrypt file names hides the list of files as well as their contents. Without it, anyone can see names like passport-scan.jpg without the password.

From PowerShell, -p with no value makes 7-Zip ask for the password, and -mhe=on encrypts the file names:

POWERSHELL
& "C:\Program Files\7-Zip\7z.exe" a -t7z -p -mhe=on Taxes.7z "$env:USERPROFILE\Documents\Taxes"

Why "Encrypt contents to secure data" isn't a folder password

That checkbox in a folder's Properties > Advanced turns on the Encrypting File System (EFS). EFS ties the files to your Windows account. Anyone signed in as you opens them normally, with no password prompt, and someone with a different account can't open them at all. It's only available on Windows Pro, Enterprise and Education, which is why the box is greyed out on Windows Home.

Send a locked folder to someone else

A 7z file or a Mac disk image is awkward for a recipient on the other system. An AES-256 ZIP is the most portable choice:

  1. Open Encrypt ZIP, choose the folder, and set a long password. The Password Generator can create one.
  2. Download the ZIP and open it yourself to confirm the password works.
  3. Send the ZIP, then send the password through a different channel, such as a text or phone call.

Two details catch people out:

  • File names stay visible in a ZIP. ZIP encryption protects the contents but not the names. Rename revealing files before you zip them, or use a 7z archive with encrypted names when the recipient has 7-Zip.
  • The recipient may need an app. The built-in Windows and macOS archive tools may not open AES-encrypted ZIPs. 7-Zip on Windows and Keka on Mac handle them.

For a single document, Encrypt PDF keeps it a normal PDF that opens in any PDF reader.

Tip: Open the protected copy and check every file before you delete the original. A typo in the password or an unfinished archive is easy to fix while the original still exists, and impossible afterwards.

Copies the password doesn't cover

  • Cloud sync history. OneDrive, iCloud Drive, Dropbox and Google Drive can keep earlier versions and deleted files for weeks. Check the service's version history and trash after you delete the original.
  • The open copy. While the disk image is mounted or the archive's files are extracted, anyone at the computer can read them.
  • A forgotten password. None of these methods has a recovery option. Save the password in a password manager.

Questions people ask

Can I password-protect a folder on Windows without installing anything?

Not with a password. Windows has no built-in folder password. In the browser, Encrypt ZIP creates an AES-256 ZIP of a folder without installing anything, but you or the recipient still need an app such as 7-Zip to open it.

Is a password-protected ZIP as secure as a disk image?

With AES-256 and a long, unique password, both resist guessing. The weak point is usually the password itself or an older ZIP encryption setting, so check that the method says AES-256.

Can I hide a folder instead?

Hiding a folder only removes it from normal view. Anyone who shows hidden files can open it. Use encryption when the contents need to stay private.

What if I need to add files later?

On a Mac, choose the read/write image format and copy new files into the mounted image. On Windows, open the 7z archive in 7-Zip and add files. 7-Zip asks for the password again.

References