Password protection in Excel works differently depending on whether you want to lock the whole file or just the sheets inside it
Excel gives you two separate protections. You can password-protect the file itself so nobody can open it without the password — this is the strongest option. Or you can protect individual sheets within a file so people can open the file but cannot edit specific sheets, change formulas, or move data around. Most people want sheet protection, not file protection, because it lets colleagues open and read your work while preventing accidental changes.
The steps differ slightly between Excel on Windows, Excel on Mac, and Excel online. Windows and Mac use the same general approach but with different menu locations. Excel online has fewer protection options and works only if you save to OneDrive or SharePoint.
Key Takeaways
- File protection (password to open the file) is stronger but locks everyone out until they enter the password; sheet protection (password to edit) lets people read your work but prevents changes.
- On Windows, go to File > Info > Protect Workbook > Encrypt with Password to protect the entire file, or Review > Protect Sheet to lock individual sheets.
- On Mac, use File > Properties > Security to encrypt the file, or Tools > Protect Sheet for individual sheets.
- Sheet protection does not hide data — it only prevents editing — so do not rely on it for confidential information.
- If you forget the password, there is no built-in recovery; you will need to use a third-party tool or recreate the file.
How to password-protect an entire Excel file on Windows
Open the file you want to protect. Click the File tab in the top left, then click Info. On the right side, you will see a button that says "Protect Workbook" with a dropdown arrow next to it. Click that dropdown and select "Encrypt with Password."
A dialog box will appear asking you to enter a password. Type your password, then click OK. Excel will ask you to type it again to confirm. Once you click OK, the file is encrypted. The next time someone tries to open it — including you — Excel will ask for the password before showing any content.
Write down your password and store it somewhere safe. If you forget it, you cannot recover the file without using specialized recovery software, which may or may not work depending on the file size and your Excel version.
How to password-protect individual sheets on Windows
Open the file and click on the sheet tab you want to protect at the bottom of the screen. Go to the Review tab at the top. Click "Protect Sheet" (it may also say "Protect Current Sheet" depending on your Excel version).
A dialog box will open with options. You can enter a password if you want — this password will be required to unprotect the sheet later. Below that, you will see checkboxes for what users can do: select cells, format cells, insert rows, delete columns, and so on. By default, most actions are blocked. Uncheck any boxes for actions you want to allow, then click OK.
If you entered a password, Excel will ask you to confirm it. Once you click OK, the sheet is protected. Users can still open the file and read the data, but they cannot edit cells, change formulas, or alter the sheet structure unless they know the password.
Repeat this process for each sheet you want to protect. You can protect some sheets and leave others unprotected in the same file.
How to password-protect an Excel file on Mac
Open the file. Click File in the menu bar, then look for "Properties" or "Save As" depending on your Excel version. In the Properties window, look for a Security section. Click the checkbox next to "Encrypt file contents" and enter a password twice to confirm.
For sheet protection on Mac, click the Tools menu at the top, then select "Protect Sheet." Enter a password if you want one, choose which actions to allow or block, and click OK. The process is the same as Windows, but the menu location is different.
How to password-protect sheets in Excel online
Excel online has limited protection options. You cannot encrypt the entire file with a password, but you can protect individual sheets. Open your file in Excel online, click the Review tab, and select "Protect Sheet."
A panel will open on the right side. You can enter a password and choose which actions to allow. Click Protect. The sheet is now protected, though the protection is lighter than in the desktop version — some advanced users may be able to work around it.
File-level encryption in Excel online is not available. If you need to encrypt the entire file, download it to your computer, encrypt it there, and upload it back to OneDrive or SharePoint.
What password protection actually does and does not do
Sheet protection prevents editing but does not hide data. If you protect a sheet, someone can still read every cell, copy the data, and paste it elsewhere. Protection only stops them from changing what is in the file itself. If your spreadsheet contains sensitive information like salary data or customer lists, sheet protection alone is not enough — you need file-level encryption or a different storage method.
File-level encryption (password to open) is stronger because the file itself is unreadable without the password. However, once someone enters the password and opens the file, they can see and copy everything unless you also protect individual sheets.
Password protection in Excel uses encryption, but the strength depends on your Excel version and the password length. Longer passwords (12 characters or more, mixing letters, numbers, and symbols) are harder to crack than short ones.
What to do if you forget the password
Excel does not have a built-in password recovery feature. If you forget the password to a protected sheet, you can unprotect it using a third-party tool, though success is not may provide. If you forget the password to an encrypted file, the file may be unrecoverable without specialized software.
The best approach is to store passwords in a password manager like Bitwarden, 1Password, or KeePass. These tools encrypt your passwords and let you retrieve them when you need them. If you use a password manager, you only have to remember one strong master password.
Frequently Asked Questions
Can someone break a password-protected Excel file?
Sheet protection can be removed with third-party tools relatively easily. File-level encryption is much harder to break, especially if you use a long password. Neither is unbreakable, but encryption is significantly stronger. Do not rely on Excel passwords for highly sensitive data — use a dedicated encryption tool or keep sensitive files offline.
Can I protect some cells but not others?
Yes, but it requires an extra step. Before protecting the sheet, select the cells you want to allow editing on, right-click, choose Format Cells, go to the Protection tab, and uncheck "Locked." Then protect the sheet. Now only the unlocked cells can be edited. This works on Windows and Mac but not reliably in Excel online.
What if I protect a sheet and then forget which cells are unlocked?
Go to the Home tab, click Find & Select (or use Ctrl+H on Windows, Cmd+H on Mac), and choose "Go To Special." Select "Unlocked Cells" to highlight all cells that users can edit. This shows you exactly which cells are editable without unprotecting the sheet.
Can I protect a file with a password and also protect sheets inside it?
Yes. You can encrypt the entire file with one password and protect individual sheets with different passwords. This adds two layers of protection — someone needs the file password to open it, and then they need sheet passwords to edit specific sheets.
Does password protection work if I share the file via email or cloud storage?
Yes. The protection stays with the file no matter how you share it. If you email an encrypted file, the recipient will need the password to open it. If you upload a sheet-protected file to OneDrive or Google Drive, the protection remains active when others download or open it.