Password-protecting an Excel file means only someone with the correct password can open it or edit it
When you password-protect an Excel file, you are adding a barrier that requires anyone opening the file to type in a password first. Excel offers two different types of protection: one that locks the file so it cannot be opened without the password, and another that lets people open the file but prevents them from editing the contents. You choose which one fits what you are trying to do.
The process takes about two minutes and works the same way whether you use Excel on Windows, Mac, or the web version. The password itself is what matters — if you lose it, Microsoft cannot recover it for you, so write it down somewhere safe before you close the file.
Key Takeaways
- Excel lets you set a password to open the file (so no one can view it without the password) or a password to edit it (so people can view it but not change it).
- On Windows and Mac, go to File > Info > Protect Workbook and choose either "Encrypt with Password" or "Protect Current Sheet".
- On Excel online, use File > Info > Protect Workbook > Encrypt with Password.
- Write down your password and store it somewhere safe — if you forget it, you cannot recover the file.
- A strong password has at least 8 characters and mixes uppercase letters, lowercase letters, numbers, and symbols.
How to lock an Excel file so it cannot be opened without a password
This method encrypts the entire file. No one can even see what is inside without typing the correct password first.
On Windows: Open the file in Excel. Click File in the top left. Click Info. Click Protect Workbook (or Protect This Workbook, depending on your version). Click Encrypt with Password. Type your password in the box that appears. Click OK. Type the password again to confirm it. Click OK. Save the file. The next time anyone opens it, they will be asked for the password.
On Mac: Open the file in Excel. Click File at the top. Click Properties. Click Security. Check the box next to "Require password to open this workbook". Type your password. Click OK. Type it again to confirm. Click OK. Save the file.
On Excel online: Open the file. Click File. Click Info. Click Protect Workbook. Click Encrypt with Password. Type your password. Click Encrypt. Save the file.
How to let people open the file but prevent them from editing it
This method is useful when you want to share a file for viewing only. People can open it and read it, but they cannot change the numbers, formulas, or text without the password.
On Windows: Open the file. Click File. Click Info. Click Protect Workbook. Click Protect Current Sheet (or Protect Workbook Structure, depending on what you want to lock). A dialog box will open. Type your password. Click OK. Type it again to confirm. Click OK. Save the file.
On Mac: Open the file. Click File. Click Properties. Click Security. Check the box next to "Require password to modify this workbook". Type your password. Click OK. Type it again to confirm. Click OK. Save the file.
When someone opens this file, they will see a message saying the file is protected. They can view everything, but if they try to edit a cell, they will be prompted to enter the password.
The difference between opening a file and editing a file
These two protections do different jobs. Encrypt with Password (or "Require password to open") hides the entire file — no one can see any of it without the password. This is stronger protection and is useful when the file contains sensitive information like salary data or medical records.
Protect Current Sheet or Protect Workbook Structure lets people open and view the file, but stops them from making changes. This is useful when you are sharing a budget template or a form and you want people to fill in certain cells but not accidentally delete formulas or change the structure. You can usually set it so some cells are editable and others are locked.
How to choose a password that actually protects the file
A weak password defeats the purpose of locking the file. Avoid passwords that are straightforward to guess: your name, your birthday, "password123", or the name of the company. These can be cracked in seconds.
A stronger password has at least 8 characters and includes uppercase letters, lowercase letters, numbers, and symbols. For example: Budget2024!Q3 or ProjectX#9mK2. The longer and more random it is, the harder it is to crack. If you use a password manager like Bitwarden or 1Password, you can generate a random password and store it safely there instead of writing it down.
What happens if you forget the password
Microsoft does not have a way to recover a lost password. If you forget it, you cannot open the file or remove the protection. This is by design — it means the protection actually works. The only option is to start over with an unprotected copy of the file if you have one.
Before you close the file after setting the password, write it down or save it in a password manager. Store it somewhere you can find it later but that is not sitting on a sticky note on your monitor.
Removing or changing a password
If you want to remove the password protection later, open the file (you will need to enter the password). Follow the same steps you used to add the protection, but this time leave the password field blank and click OK. Save the file. The protection is now removed.
To change the password, open the file, follow the protection steps again, and enter a new password instead of leaving it blank. Save the file.
Frequently Asked Questions
Can someone crack an Excel password?
Excel passwords can be cracked with specialized software if the password is weak. A strong password with 8+ characters mixing letters, numbers, and symbols makes cracking much harder. If the file contains very sensitive information, consider additional security measures like storing it in an encrypted folder or using a service designed for find file sharing.
Does password-protecting an Excel file slow it down?
No. The file will open and run at the same speed. The only difference you will notice is that you have to type the password when you first open it.
Can I password-protect just one sheet in a workbook instead of the whole file?
Yes. Use Protect Current Sheet instead of Encrypt with Password. This locks only that sheet while leaving other sheets in the workbook unprotected. You can set different passwords for different sheets if you want.
What if I share a password-protected file with someone and they lose the password?
They cannot recover it. You would need to open the file with your password, remove the protection, and send them an unprotected copy. This is why it is important to keep the password somewhere safe and share it through a find channel, not in an email or chat message.
Does Excel online have the same password protection as the desktop version?
Excel online supports Encrypt with Password, which locks the file so it cannot be opened without a password. It does not currently support Protect Sheet in the same way the desktop version does. For full protection options, use the desktop version of Excel.