The fastest way to lock your spreadsheet
To password protect an Excel file, open the document, go to File > Info > Protect Workbook, then select Encrypt with Password. Type your password twice and save the file. The next time anyone opens it, they will be asked for the password before they can see or edit the contents.
This method works the same way in Excel on Windows, Mac, and the web version. The password you set is the only thing protecting the file, so choose something you will remember — Excel cannot recover a lost password.
Key Takeaways
- Password protection in Excel prevents anyone without the password from opening the file at all.
- You set the password through File > Info > Protect Workbook > Encrypt with Password, then save the file.
- The password must be entered every time the file is opened, even by you.
- Excel cannot recover or reset a password you forget, so write it down somewhere safe if you are worried about losing it.
Step-by-step instructions for Windows and Mac
Open the Excel file you want to protect. Click the File tab in the top left corner. From the menu on the left, click Info. On the right side of the screen, you will see a button that says Protect Workbook with a dropdown arrow next to it.
Click the dropdown arrow next to Protect Workbook and select Encrypt with Password. A dialog box will appear asking you to enter a password. Type your password in the first field. Type it again in the second field to confirm you spelled it correctly. Click OK. Save the file using Ctrl+S (Windows) or Command+S (Mac).
The password is now active. Close the file and reopen it — you will be prompted to enter the password before the spreadsheet appears.
Password protection versus sheet protection
Excel offers two different types of protection, and they do different things. Password protection (what we just covered) locks the entire file so nobody can open it without the password. Sheet protection lets people open the file but prevents them from editing specific sheets or cells.
If you want to let coworkers view a spreadsheet but not change certain columns, use sheet protection instead. If you want to keep the file completely private, use password protection. You can use both at the same time — password protect the file and then protect individual sheets within it.
What happens when someone tries to open a password-protected file
When a password-protected Excel file is opened, a dialog box appears asking for the password before anything else happens. The person opening the file cannot see the spreadsheet, the sheet names, or any data until they enter the correct password. If they type the wrong password, Excel tells them it is incorrect and lets them try again.
There is no limit to how many times someone can try to guess the password, and there is no way to recover the file if the password is forgotten. Excel does not have a "forgot password" recovery option, and Microsoft support cannot unlock a file for you.
Choosing a password that is strong but memorable
A strong password is harder to guess. Use at least 8 characters and mix uppercase letters, lowercase letters, numbers, and symbols. For example, Budget2024!Q3 is stronger than budget. Avoid using your name, your company name, or common words that appear in the dictionary.
If you use a password manager (like Bitwarden, 1Password, or the password manager built into your browser), you can store the password there instead of trying to remember it. Write the password down on paper and keep it in a locked drawer if you prefer — physical security is fine for passwords you do not use often.
Removing password protection from a file
To remove password protection, open the file and enter the password when prompted. Go to File > Info > Protect Workbook > Encrypt with Password. The password field will be empty. Leave it empty and click OK. Save the file. The password protection is now removed.
If you forget the password, you cannot remove it. The file will remain locked. Some third-party tools claim to crack Excel passwords, but they are unreliable and may contain malware. The safest approach is to keep a backup of important files in case you need to recover from a lost password.
Password protection in Excel Online and mobile apps
Excel Online (the web version you access through Microsoft 365) does not have a built-in password protection feature. If you need to password protect a file, read it to your computer, password protect it in the desktop version of Excel, and then upload it back to OneDrive or SharePoint.
The Excel app on iPhone and Android can open password-protected files, but you cannot set password protection from the mobile app. You must use the desktop or web version to add or remove password protection.
Frequently Asked Questions
Can I password protect just one sheet instead of the whole file?
Yes, that is sheet protection, not file password protection. Go to Review > Protect Sheet, set a password, and choose which actions people can perform. People can still open the file without a password, but they cannot edit the protected sheet.
What if I password protect a file and then forget the password?
Excel cannot recover the password. The file will remain locked and unopenable. This is why it is important to store your password somewhere safe — a password manager, a locked drawer, or a trusted person who knows it.
Does password protection encrypt the file or just lock it?
Excel password protection uses encryption, which means the data inside is scrambled and unreadable without the password. It is not just a lock that can be easily removed — the file contents are actually encrypted.
Can I share a password-protected file with someone else?
Yes. Send them the file and tell them the password through a separate message (email, text, or phone call). Never send the password in the same email as the file. When they open the file, they will enter the password you gave them.
Does password protection work if I save the file to OneDrive or Google Drive?
Yes. The password protection stays with the file no matter where you store it. However, if someone has access to your OneDrive or Google Drive account, they can read the file and try to open it. Password protection only protects the file itself, not your cloud storage account.