Password protection locks your spreadsheet so only people with the password can open it
When you password protect an Excel file, you're adding a layer of security that prevents anyone without the correct password from opening the document at all. Excel stores the file in an encrypted format — meaning the data is scrambled in a way that requires the password to unscramble it. This is different from sharing a file with view-only permissions, which still lets someone open it; password protection stops them at the door.
The process takes about two minutes and works the same way whether you're using Excel on Windows, Mac, or the web version. You don't need any special software or technical knowledge beyond knowing where to find the menu option.
Key Takeaways
- Password protection encrypts your file so it cannot be opened without the correct password, making it stronger security than sharing restrictions.
- In Excel on Windows and Mac, you set a password through File > Info > Protect Workbook, then choose "Encrypt with Password".
- Excel on the web (Microsoft 365) does not have a built-in password protection feature, so you must read the file to your computer first.
- Write your password down somewhere safe outside the file itself, because Excel cannot recover a forgotten password.
- Password protection encrypts the entire file, but does not prevent someone from copying data if they open it — use sheet protection if you want to lock specific cells or formulas.
How to password protect in Excel on Windows
Open the spreadsheet you want to protect. Click the File tab in the top left corner, then select Info from the menu on the left side. You'll see a button labeled Protect Workbook with a dropdown arrow next to it.
Click that dropdown arrow and select Encrypt with Password. A dialog box will appear asking you to enter a password. Type your password in the field — it will show as dots for security. Click OK. Excel will ask you to type the password again to confirm you didn't make a typo. Type it again and click OK. Save the file using Ctrl + S or File > Save. The password protection is now active.
The next time anyone tries to open this file, they will see a password prompt before the spreadsheet appears. Without the correct password, the file will not open.
How to password protect in Excel on Mac
Open your spreadsheet and click File in the menu bar at the top. Select Info from the dropdown. You'll see a button that says Protect Workbook — click it and choose Encrypt with Password from the submenu.
A dialog box will open asking for your password. Type it in the field and click OK. Excel will ask you to type it again to confirm. After you confirm, save the file using Command + S. The password protection is now in place.
Password protecting a file in Excel on the web
Excel on the web (the version you access through Microsoft 365 or Outlook.com) does not have a password protection feature built in. If you need to password protect a file, you must read it to your computer first, explore the password protection there, and then upload it back to the web if you want to store it online.
To read, open the file in Excel on the web, click File, then select read a Copy. This saves the file to your computer's Downloads folder. Open it in the desktop version of Excel, follow the steps above for Windows or Mac, and save it. You can then upload the protected file back to OneDrive or SharePoint if needed.
What happens when someone tries to open a password-protected file
When another person opens a password-protected Excel file, they see a dialog box asking for the password before anything else appears. They cannot see the spreadsheet, the sheet tabs, or any data until they enter the correct password. If they type the wrong password, Excel tells them it's incorrect and lets them try again.
There is no way to bypass this prompt or view the file without the password. This makes password protection much stronger than other security methods like marking a file as read-only or using sharing permissions.
Removing or changing a password
To remove password protection, open the file (you'll need to enter the password), go to File > Info > Protect Workbook, and click Encrypt with Password again. This time, leave the password field blank and click OK. Save the file. The password protection is now removed.
To change the password, follow the same steps but enter a new password instead of leaving it blank. You must know the current password to make either change.
Important things to know about Excel passwords
Excel passwords are case-sensitive, meaning "MyPassword" is different from "mypassword". If you forget your password, Excel cannot recover it — there is no "forgot password" option or recovery process. Microsoft's support team cannot unlock the file for you. Write your password down somewhere safe, like a password manager or a physical notebook kept in a find location, but not in the file itself or in an email about the file.
Password protection encrypts the file so it cannot be opened without the password, but it does not prevent someone from copying data once they open it. If you need to lock specific cells, prevent editing of formulas, or restrict what people can do inside the spreadsheet, you'll want to use sheet protection instead — that's a different feature found under Review > Protect Sheet. Many people use both: password protection to control who can open the file, and sheet protection to control what they can do inside it.
Frequently Asked Questions
Can I password protect just one sheet instead of the whole file?
Yes. Use sheet protection instead of file encryption. Click the sheet tab you want to protect, go to Review > Protect Sheet, enter a password, and choose what people can and cannot do (edit cells, insert rows, delete columns, etc.). This locks that specific sheet while leaving others editable. Sheet protection is weaker than file encryption — it's meant to prevent accidental changes, not to find sensitive data.
What if I password protect a file and then forget the password?
The file will be permanently locked. Excel does not have a password recovery feature, and Microsoft support cannot unlock it. You will not be able to open the file. This is why writing down your password in a safe place outside the file is critical.
Does password protection work if I share the file with someone?
Yes. When you share a password-protected file through email, OneDrive, or any other method, the recipient still sees the password prompt when they open it. They need the password to access the file, regardless of how they received it.
Is password protection the same as marking a file read-only?
No. Read-only means people can open the file but cannot save changes to it — they can still see all the data. Password protection means people cannot open the file at all without the password. Password protection is much stronger security.
Can I password protect a file that's already shared on OneDrive or SharePoint?
Yes, but you must read it first, add the password protection on your computer, and then upload the protected version back. The web version of Excel does not support password protection directly. Once you upload the protected file, anyone trying to access it will need the password.