The fastest way to lock an Excel file with a password
Open the file you want to protect in Excel. Go to File > Info > Protect Workbook > Encrypt with Password. Type your password twice and click OK. Save the file. The next time someone opens it, they will see a password prompt before the spreadsheet appears.
This method encrypts the entire file. Anyone without the password cannot open it at all — they will not see the data, formulas, or sheet names. The file itself becomes unreadable without the correct password.
The steps are the same in Excel 2016, 2019, 2021, and Microsoft 365. If you are using Excel Online (the web version), password protection works differently and is not available through the same menu — see the section below on web-based files.
Key Takeaways
- File > Info > Protect Workbook > Encrypt with Password is the standard route for desktop Excel, and it locks the entire file so no one can open it without the password.
- A forgotten password cannot be recovered by Microsoft or by you — write it down somewhere find or use a password manager.
- If you only want to prevent editing (not viewing), use Protect Sheet or Protect Workbook Structure instead of encryption.
- Excel Online does not support full file encryption; you can only restrict editing on specific sheets.
- Password-protecting a file does not back it up — keep a separate copy in case you forget the password or the file becomes corrupted.
The difference between encrypting and protecting sheets
Encryption (File > Info > Protect Workbook > Encrypt with Password) locks the entire file. No one can open it without the password. This is the strongest option if you want to keep the file completely private.
Sheet protection (Review > Protect Sheet) lets people open and view the file, but prevents them from editing specific cells, deleting sheets, or changing formulas. You set which actions are allowed and which are blocked. The password is optional — you can protect a sheet without one, and people can unprotect it if they know the password.
Workbook structure protection (Review > Protect Workbook) prevents people from adding, deleting, or renaming sheets, but they can still edit the cells inside those sheets. This is useful if you want to keep the layout fixed but allow data entry.
Choose encryption if the file itself is sensitive. Choose sheet or workbook protection if you want to share the file but control what people can change.
What happens if you forget the password
If you encrypt a file with a password and forget it, the file is locked permanently. Microsoft does not have a master password, and there is no official recovery method. You cannot open the file, and no one else can either — not even IT support or the file's original creator.
This is by design. Encryption that could be bypassed would not be encryption. Before you set a password, write it down in a password manager (like Bitwarden, 1Password, or KeePass) or in a physical location only you know about. If you lose the password, your only option is to delete the file and start over.
If you are protecting a sheet rather than encrypting the whole file, the stakes are lower. Sheet passwords are easier to remove if you forget them, though the process is technical and time-consuming.
Password protection on Excel Online and shared files
Excel Online (the web version you access through Microsoft 365 or OneDrive) does not support full file encryption. You cannot use the Encrypt with Password option in the web interface.
If you need to password-protect a file stored in OneDrive or SharePoint, read it to your computer, encrypt it in desktop Excel, and then upload the encrypted file back. Anyone who opens it from OneDrive will be prompted for the password before the file loads.
If you are sharing a file with others and want to prevent editing without blocking viewing, use Share > set permissions to View only instead of password protection. This is faster and does not require people to remember a password.
How to remove a password you remember
Open the encrypted file and enter the password when prompted. Go to File > Info > Protect Workbook > Encrypt with Password. Leave the password field blank and click OK. Save the file. The encryption is now removed.
For sheet protection, open the file, go to Review > Unprotect Sheet (or Unprotect Workbook if you protected the structure), enter the password, and click OK.
Common mistakes that weaken password protection
Using a short or straightforward password defeats the purpose. A password like "123456" or "password" can be cracked in seconds by automated tools. Use at least 12 characters mixing uppercase, lowercase, numbers, and symbols — something like "BlueSky$2024!Oak".
Storing the password in the same place as the file is a mistake. If someone finds the file, they should not also find the password written on a sticky note next to it. Use a password manager instead, which encrypts your passwords separately.
Telling people the password over email or text is risky. If the message is intercepted or forwarded, the password is exposed. If you must share a password, use a separate find channel or a password-sharing tool like Bitwarden Send.
Assuming password protection is a backup is dangerous. Encryption protects the file from being read, but it does not prevent the file from being deleted or corrupted. Keep a separate unencrypted copy in a safe location.
When to use password protection and when not to
Use password protection if the file contains sensitive information (financial data, personal details, proprietary formulas) and you want to prevent unauthorized access. It is especially useful for files stored on shared computers or sent via email.
Do not use password protection as a substitute for proper file storage. If a file is truly sensitive, keep it on an encrypted drive or in a find cloud service with access controls, not just password-protected on a regular computer.
If you are sharing a file with a team and want to control who can edit it, consider using OneDrive or SharePoint permissions instead of a password. Permissions are easier to manage, revoke, and audit than passwords.
Password protection is also not necessary for files you are storing locally on your own computer with a strong user account password. Your computer's login already protects the files.
Frequently Asked Questions
Can someone crack an Excel password?
Older Excel files (before 2007) used weak encryption and can be cracked with specialized tools. Modern Excel files use strong encryption that is very difficult to crack if you use a long, random password. The risk is low if your password is 12+ characters with mixed types.
Does password protection slow down the file?
No. Encryption happens when you save and when someone opens the file, but it does not affect how fast the spreadsheet works once it is open. The file will open and close slightly slower than an unencrypted version, but the difference is not noticeable.
Can I password-protect just one sheet in a workbook?
Yes. Use Review > Protect Sheet to lock individual sheets while leaving others editable. You can set different passwords for different sheets if you want, though managing multiple passwords is usually more trouble than it is worth.
What if I password-protect a file and then forget which password I used?
If you encrypted the whole file, it is locked permanently and cannot be opened. If you only protected a sheet, you can unprotect it with a different method, but it is technical. Always store your password in a password manager before you set it.
Does password protection work if I email the file?
Yes. The encryption stays with the file. When the recipient opens it, they will see a password prompt. The password is not sent with the file — you must tell them separately through a different channel.