Password protection in Excel works at the file level, not the sheet level

When you password protect an Excel file, you're locking the entire workbook so that anyone who opens it must enter your password first. Excel offers two separate protections: one that requires a password to open the file at all, and another that lets people open it but prevents them from editing specific sheets or cells without a password. Most people want the first one — a password to open the file itself.

The steps differ slightly depending on whether you're using Excel on Windows, Mac, or the web version. Desktop versions give you the most control. The web version (Excel Online) has limited protection options and stores passwords on Microsoft's servers rather than in your file, which is worth knowing if you're concerned about where your password lives.

Key Takeaways

  • To password protect an Excel file on Windows or Mac, use File > Info > Protect Workbook > Encrypt with Password, then enter your password twice.
  • A password to open the file is different from a password to edit sheets — you can set both, or just one, depending on what you need.
  • Excel stores the password inside the file itself on desktop versions, so if you forget it, there is no recovery option and no "forgot password" button.
  • The web version of Excel (Excel Online) has weaker protection options and stores passwords on Microsoft's servers, not in your file.
  • Password protecting a file does not encrypt the data inside it — it only locks access to the file; the password itself is not encrypted during transmission.

Setting a password to open the file on Windows

Open the Excel file you want to protect. Click the File tab in the top left, then select Info from the left sidebar. Look for a button labeled "Protect Workbook" — it may say "Protect Workbook" or show a dropdown arrow next to it.

Click "Protect Workbook" and select "Encrypt with Password" from the menu. A dialog box will appear asking you to enter a password. Type your password, then click OK. Excel will ask you to enter the password again to confirm it. Once you click OK the second time, the file is protected. Save the file — the protection takes effect immediately.

The next time anyone opens this file, Excel will prompt them for the password before the spreadsheet appears. Without the correct password, the file will not open at all.

Setting a password to open the file on Mac

Open the Excel file and click File in the menu bar at the top. Select "Properties" from the dropdown menu. In the Properties window, look for a section labeled "Protect" or "Security" — the exact wording varies by Excel version.

Click "Protect Workbook" and choose "Encrypt with Password." Enter your password in the dialog box, then enter it again to confirm. Click OK, then save the file. The protection is now active.

If you do not see a "Protect Workbook" option, your version of Excel may use a different path. Try File > Save As, then look for an "Options" or "Security" button in the save dialog — some older Mac versions put password protection there instead.

The difference between opening passwords and editing passwords

Excel lets you set two different passwords if you want. An opening password locks the entire file — nobody can see anything without entering it. An editing password lets people open the file and view it, but they need a different password to make changes or unprotect specific sheets.

To set both, follow the steps above for the opening password first. Then go back to File > Info > Protect Workbook and look for "Protect Current Sheet" or "Protect Sheet." This opens a different dialog where you can set a password that controls editing permissions only. Someone can open the file and read it, but they cannot edit cells or change formulas without the editing password.

Most people only need the opening password. The editing password is useful if you want to share a file with colleagues who should be able to read it but not change it — though there are easier ways to do that through file sharing permissions in OneDrive or SharePoint.

What happens if you forget your password

Excel does not have a password recovery option. If you forget the password to open a file, there is no "forgot password" button, no recovery email, and no way to contact Microsoft to unlock it. The file will remain locked.

This is different from your Microsoft account password, which you can reset through Microsoft's website. The password inside the Excel file is stored locally in that file only. If you lose it, the file is inaccessible.

For this reason, store your Excel passwords somewhere secure — a password manager like Bitwarden, 1Password, or KeePass is better than writing them down or storing them in an email. If you use a password manager, you can recover the password if you forget it, but you still cannot recover the file if the password manager itself fails.

Password protection versus encryption

Password protecting an Excel file is not the same as encrypting it. When you set a password, Excel locks access to the file, but the data inside is not encrypted. If someone gains access to the file through other means — by copying it from your computer, intercepting it during upload, or accessing your cloud storage — they could potentially read the contents without the password, depending on how the file is stored and transmitted.

For sensitive financial data, health information, or personal details, password protection alone may not be enough. Consider storing the file in an encrypted folder (Windows Bitlocker, Mac FileVault, or third-party tools like VeraCrypt) or using a service like OneDrive or SharePoint that encrypts files in transit and at rest. These add a layer of protection beyond the password.

Using password protection with Excel Online

Excel Online (the web version you access through Office.com or OneDrive) does not have a built-in password protection feature. You cannot set a password to open an Excel file directly in the web version.

If you need password protection, download the file to your computer, password protect it using the desktop version of Excel, then upload it back to OneDrive. When someone tries to open it from OneDrive, they will be prompted for the password. Alternatively, you can control who can access the file through OneDrive's sharing settings — you can make it private, share it with specific people, or require a password to access your OneDrive folder itself, though that is a different kind of protection.

Removing or changing a password

To remove a password, open the file (you will need to enter the current password), then go to File > Info > Protect Workbook > Encrypt with Password. Leave the password field blank and click OK. Save the file. The password protection is now removed.

To change a password, follow the same steps but enter your new password instead of leaving it blank. You will need to know the old password to make this change.

Frequently Asked Questions

Can someone crack an Excel password?

Yes, with enough time and computing power. Excel passwords are not as strong as encryption keys. Tools exist that can attempt to guess passwords, especially if the password is short or uses common words. A long password with a mix of uppercase, lowercase, numbers, and symbols is harder to crack than a simple one, but no password is unbreakable.

Does password protecting a file slow down Excel?

No. Password protection has no effect on how fast the file opens or how it performs once it is open. The only delay is the few seconds it takes to enter the password when you first open the file.

Can I password protect just one sheet instead of the whole file?

Yes. Go to File > Info > Protect Workbook > Protect Current Sheet, then set a password. This protects only that sheet from editing, but the file itself remains unprotected — anyone can still open it and see other sheets. You can protect multiple sheets individually with different passwords if you want.

What if I password protect a file and then share it through OneDrive?

The password protection stays with the file. When someone opens it from OneDrive, they will be prompted for the password before they can see the spreadsheet. OneDrive's sharing settings control who can access the file at all; the Excel password controls who can open it once they have it.

Is a password-protected Excel file safe to email?

Password protection prevents someone from opening the file without the password, but it does not encrypt the file during transmission. If an email is intercepted, the file could potentially be read by someone with the right tools, even with a password. For highly sensitive files, consider encrypting the email itself or using a secure file transfer service instead of email.