Password protection in Excel works differently depending on whether you want to lock the entire file or just specific sheets
Excel offers two main ways to add a password: you can require a password to open the file itself, or you can protect individual sheets so people can view them but cannot edit cells, change formulas, or alter the structure. Most people use sheet protection for shared files where you want to prevent accidental changes, and file-level passwords when the spreadsheet contains sensitive information like financial data or personal details.
The steps differ slightly between Windows and Mac, and between newer versions (Excel 2016 and later) and older ones. This guide covers the current versions on both platforms.
Key Takeaways
- File-level passwords prevent anyone from opening the spreadsheet without entering the correct password first.
- Sheet protection lets people open and view the file but prevents them from editing cells, deleting rows, or changing formulas without a password.
- On Windows, file passwords go in File > Info > Protect Workbook, while sheet protection is under the Review tab.
- On Mac, both options are in the Tools menu under Protect Workbook and Protect Sheet.
- Excel passwords are case-sensitive, so "MyPassword" and "mypassword" are treated as different passwords.
How to password-protect an entire Excel file on Windows
To require a password before anyone can open your spreadsheet, go to File in the top left, then click Info. On the right side, you will see a button labeled Protect Workbook with a dropdown arrow. Click that arrow 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 save the file, anyone trying to open it will see a password prompt before the spreadsheet appears. If someone enters the wrong password, the file will not open.
Write down your password somewhere safe. If you forget it, you cannot recover the file — Excel does not have a "forgot password" recovery option for encrypted files.
How to protect individual sheets on Windows
Sheet protection is useful when multiple people work on the same file but you want to prevent certain changes. Go to the Review tab at the top of the ribbon. Click Protect Sheet.
A dialog will open with options for what people can and cannot do. By default, users can select cells and view content but cannot edit, delete, or insert rows or columns. You can adjust these settings by checking or unchecking boxes. Enter a password if you want to require one to unprotect the sheet later, then click OK. Confirm the password when prompted.
Once a sheet is protected, anyone trying to edit a cell will see a message saying the sheet is protected. They can still view all the data and formulas — protection only prevents changes, not viewing.
Password protection on Mac
On Mac, both file and sheet protection are in the Tools menu. To encrypt the entire file with a password, click Tools, then Protect Workbook, then With Password. Enter your password twice and click OK.
To protect a single sheet on Mac, go to Tools, then Protect Sheet. Choose which actions you want to allow, enter a password if needed, and click OK. The process and options are the same as Windows, just accessed through a different menu.
What happens when someone tries to open or edit a protected file
If a file is encrypted with a password, the person opening it sees a password dialog before the spreadsheet loads. They cannot view any content without entering the correct password first.
If only a sheet is protected, the file opens normally, but anyone trying to click into a cell and type will see a message saying "The sheet is protected and cannot be edited." They can still read all the data, print it, and copy text — they just cannot make changes. To unprotect the sheet, they would need to go to Review > Unprotect Sheet and enter the password.
Removing or changing a password
To remove file-level encryption on Windows, go to File > Info > Protect Workbook > Encrypt with Password. Delete the password from the box and click OK. The next time you save, the file will no longer require a password to open.
To remove sheet protection, go to Review > Unprotect Sheet and enter the password. On Mac, use Tools instead of the Review tab. If you remember the password, you can unprotect immediately. If you forget the password, you cannot unprotect the sheet without knowing it.
Things to know about Excel passwords
Excel passwords are case-sensitive, meaning uppercase and lowercase letters are treated as different characters. "Excel2024" is not the same as "excel2024". Passwords can include numbers, letters, and special characters like ! @ # $ % ^ &.
File-level passwords in Excel are strong encryption — if you forget one, there is no built-in recovery method. Sheet protection passwords are less secure; they can be removed by someone with technical knowledge, so do not rely on sheet protection for truly sensitive data. For highly confidential information, use file-level encryption instead.
If you share a password-protected file with someone, you will need to send them the password separately — it does not travel with the file. Some organizations send the password through a different channel (like a phone call or separate email) to add an extra layer of security.
Frequently Asked Questions
Can I password-protect just one sheet and leave others unprotected?
Yes. You can protect some sheets and leave others open for editing. Go to the sheet you want to protect, click Review > Protect Sheet, set your password, and click OK. Repeat for any other sheets you want protected. Unprotected sheets in the same file will remain editable.
What if I forget my file password?
There is no recovery option. Excel does not have a master password or a way to bypass file-level encryption if you forget the password. The file will be permanently locked. Store passwords in a password manager or write them down in a secure location.
Can someone remove a password I set on a sheet?
Sheet protection can be removed by someone with technical knowledge and time, so it is not suitable for highly sensitive data. File-level encryption is much stronger. If you need real security, use file-level passwords instead of sheet protection.
Does password protection work the same way in Excel Online?
Excel Online does not support adding new passwords directly in the browser. You must use the desktop version of Excel to set passwords. Once a password-protected file is uploaded to OneDrive or SharePoint, the password remains active when opened in Excel Online.
Can I use the same password for multiple sheets?
Yes. You can set the same password on multiple sheets, or use different passwords for each one. Each sheet's protection is independent, so you can mix and match as needed.