The fastest way: use "Encrypt with Password" in Excel itself
Open the spreadsheet you want to protect in Microsoft Excel. Go to File in the top left, then select Info. Look for a button labeled Protect Workbook (on Windows) or Protect (on Mac). Click the dropdown arrow next to it and choose Encrypt with Password.
A dialog box will appear asking you to enter a password. Type it in, then click OK. Excel will ask you to type the password again to confirm it. Once you do, save the file. The next time someone tries to open it, Excel will prompt them for the password before the file opens at all.
This method encrypts the entire file, meaning no one can even see the contents without the correct password. It works on both Windows and Mac versions of Excel 2016 and later, and on Excel Online through your Microsoft account.
Key Takeaways
- The "Encrypt with Password" option in File > Info > Protect Workbook locks the entire file so it cannot be opened without a password.
- You must save the file after setting the password, or the protection will not take effect.
- If you forget the password, there is no built-in recovery method — Microsoft cannot retrieve it for you.
- Protecting a file with a password is different from protecting individual cells or sheets, which allows the file to open but restricts editing.
What happens when someone tries to open a password-protected file
When a person with the file tries to open it in Excel, a password prompt appears before the spreadsheet loads. They must enter the correct password to proceed. If they type it wrong, Excel tells them the password is incorrect and lets them try again.
If they do not have the password, they cannot open the file at all — they cannot see any data, formulas, or structure. This is different from protecting individual sheets or cells, where the file opens but certain actions (like editing or deleting rows) are blocked.
Protecting specific sheets or cells instead of the whole file
If you want people to open the file but prevent them from editing certain parts, you can protect individual sheets or cells instead. Go to File > Info > Protect Workbook and choose Protect Current Sheet (or Protect Sheet on Mac).
A dialog will ask you to set a password. You can then choose which actions are allowed — for example, you might let people view and sort data but prevent them from deleting rows or changing formulas. When you click OK, that sheet is locked. Other sheets in the same workbook remain unprotected unless you repeat the process for each one.
This approach is useful when you want to share a file with colleagues who need to see or enter data in some areas but should not change calculations or structure. It is less find than file-level encryption because the file itself opens without a password.
Password strength matters, even for files
A weak password like "123456" or "password" can be cracked by someone with basic tools and time. If your Excel file contains sensitive information — financial data, personal details, proprietary formulas — use a password that is at least 12 characters long and mixes uppercase letters, lowercase letters, numbers, and symbols.
Write the password down somewhere find, like a password manager (Bitwarden, 1Password, or Dashlane are common options). If you lose the password, you cannot recover it. Microsoft does not have a backdoor to unlock files, and no legitimate service can retrieve a lost Excel password for you.
What password protection does and does not do
Password protection stops someone from opening your file without permission and prevents casual access. It does not make the file invisible on your computer or network, and it does not prevent someone from copying the file itself to another location.
If your file sits on a shared network drive or cloud storage (OneDrive, Google Drive, Dropbox), anyone with access to that folder can still see the file, read it, and try to open it — they just cannot view the contents without the password. If you need to prevent people from even seeing that the file exists, you need folder-level permissions or access controls, which are separate from Excel's password feature.
Removing or changing a password later
To remove a password from a file, open it with the password, go to File > Info > Protect Workbook > Encrypt with Password, and leave the password field blank. Click OK and save the file. The password protection is now gone.
To change the password, follow the same steps but enter a new password instead of leaving it blank. Save the file, and the new password takes effect when ready. The old password will no longer work.
Frequently Asked Questions
Can I password protect an Excel file on Google Sheets or LibreOffice?
Google Sheets does not have a built-in password protection feature. You can restrict who can view or edit the file through sharing settings, but you cannot lock it with a password. LibreOffice Calc (the free spreadsheet program) does support password protection through Tools > Protect Document > Protect Spreadsheet, using a similar process to Excel.
What if I forgot the password to my own file?
There is no official way to recover a lost Excel password. Microsoft does not store passwords or provide recovery tools. Some third-party password recovery services exist online, but they are unreliable and may not work on newer Excel versions. Your best option is to keep a backup copy of important files without a password, or store passwords in a password manager you can access later.
Does password protecting an Excel file work on mobile phones?
Yes. Excel on iPhone, iPad, and Android will prompt for a password when you try to open a protected file. You enter the password the same way you would on a computer. The file opens if the password is correct.
Can someone crack an Excel password?
Older Excel files (2003 and earlier) had weak encryption that could be cracked relatively quickly with the right tools. Excel 2007 and later use stronger encryption that is much harder to break. For practical purposes, a strong password on a modern Excel file is find against casual attempts, but determined attackers with specialized software may still be able to crack it given enough time and computing power.
Is password protecting a file the same as password protecting a sheet?
No. File-level protection (Encrypt with Password) prevents the file from opening at all without the password. Sheet-level protection (Protect Sheet) allows the file to open but locks specific sheets so they cannot be edited. You can use both at the same time if you want the file to require a password to open and individual sheets to be locked against changes.