How to Password Protect a Folder

Secure your information from prying eyes

If you have important files on your Mac or PC that you want to keep private, there are several security measures you can use to protect the information. A common one is to lock your computer when you're not using it, so a password is required to bypass the login screen. You can also password-protect folders, which is useful when you use a shared laptop or desktop.

If you need help remembering passwords, use a password manager. The best ones are found in our guide to the best password managers.

How to Password Protect a Folder in Windows 

Since most versions of Windows can't password-protect files, you need a third-party application such as 7-Zip. 7-Zip is a free and open-source file archive utility that protects folders with a password.

Follow these steps to password-protect your folders with 7-Zip:

  1. Download 7-Zip and install it on your computer.

  2. Find the folder you want to password protect, right-click it, then choose 7-Zip > Add to archive.

    The Add to Archive command
  3. In the Encryption section, enter your password, then select OK.

    You can modify other attributes and settings for the compressed folder. These settings include the archive format (it's 7Z by default), the location where the archive is saved, and the compression level (set it to Store to use no compression).

    The password field in the Add to Archive window
  4. Test the password-protected folder by opening it in Windows Explorer. You should see a password prompt.

    Archive file password prompt

Going forward, anyone attempting to view or extract the files within the archive is required to enter a password.

The original folder is still on the computer and can be accessed without a password. Only the newly-created archive file is protected by a password. Delete the original folder in Windows Explorer.

How to Password Protect Using Windows' Built-In Encryption

If you don't want to use a third-party application, there may be an alternative available depending on which version of Windows you use. If you have Windows 10 Professional Edition, for example, there's an integrated encryption feature called Encrypted File System (EFS) that can add some level of security to your sensitive folders. 

Take the following steps to determine whether or not you have access to this feature:

  1. Right-click the folder you want to encrypt and select Properties.

  2. Choose the Advanced button.

    The Advanced button in Properties
  3. Look in the Compress or Encrypt attributes section for the Encrypt contents to secure data check box. If it's available, select the check box.

    The "Encrypt contents" option
  4. Select OK and choose the desired settings when prompted.

Your folder and its contents are encrypted and only accessible by your account. Someone logged in to your Windows account can access this folder without a password, so it's not a perfect solution.

Password Protect a Folder in macOS

Mac users can password protect individual folders without third-party software by using the operating system's Disk Utility app. Here's how to do it:

  1. Open Disk Utility. The easiest way is through Finder, via Applications > Utilities.


  2. Go to File > New Image > Image from Folder.

    The "Image from Folder" command
  3. Locate and select the folder you want to protect with a password, then select Choose.

    The Choose button
  4. Change the Encryption type to 128-bit AES encryption (recommended) or 256-bit AES encryption (more secure, but slower).

    Encryption options in Disk Utility
  5. Enter your password in both boxes, then select Choose.

    The Password entry window
  6. Select the Image Format drop-down menu, then choose read/write.

    You can give the DMG file a custom name and choose a different location to save it.

    The read/write option
  7. Select Save.

    The Save button
  8. Wait while the password-protected folder is created. It's finished when you see the Operation successful message. Select Done to close the prompt. You can also exit Disk Utility.

When accessing your newly-protected folder, a disk image containing the files is created once you successfully enter the password — typically alongside the protected archive. When you're done accessing the folder contents, delete this disk image by dragging it to the trash. If not, you leave its contents exposed without password protection.

Encryption vs. Password-Protected Files and Folders

Now that you know how to protect your folders and files, it's important to know the difference between encryption and password protection.

When a folder or set of files is protected by a password, the data isn't altered or rearranged. This level of protection requires a password to gain access to the files.

When the same files are encrypted, the associated data is scrambled in a way that prying eyes would have an extremely tough time deciphering. To arrange the data back to its unencrypted form, you enter a passcode or password. The difference is that if someone gains access to these files in the encrypted form and they don't know the encryption key or passcode, the contents are unreadable and useless.

Was this page helpful?