Set a password when you save the file
The simplest way to password-protect an Excel file is to add a password at the moment you save it. Open the file you want to protect, then go to File in the top-left corner and click Save As. This opens a dialog where you can choose where to save the file and what to name it.
At the bottom of the Save As dialog, you will see a button labeled Tools (on Windows) or look for Options (on Mac). Click this button and select General Options from the dropdown menu. A small window will appear with two password fields: one for opening the file and one for modifying it. You can use one password, both, or neither — it depends on what you need.
If you set a password to open the file, anyone who tries to open it will be prompted to enter that password first. If you set a password to modify the file, people can open it without a password but cannot make changes unless they enter the modification password. Type your password in whichever field applies, then click OK. Excel will ask you to type the password again to confirm it. Click Save and your file is now protected.
Key Takeaways
- The password to open a file prevents anyone from viewing the spreadsheet without entering the correct password first.
- The password to modify a file lets people view the spreadsheet but blocks them from making changes unless they know the password.
- You set both passwords in the same place: File > Save As > Tools (or Options) > General Options.
- You must type the password twice to confirm it, and Excel will not show you what you typed, so write it down before you start if you are worried about forgetting it.
- If you forget the password, there is no built-in recovery method — you will need to contact Microsoft support or use a third-party recovery tool.
The difference between opening and modifying passwords
An opening password is the stronger of the two. When you set one, the file stays locked until someone types the correct password. This is useful when the spreadsheet contains sensitive information — financial records, personal data, or anything you do not want others to see at all. Without the password, the file cannot be opened in Excel or viewed in any other program.
A modifying password is weaker but still useful. It lets people open and read the file, but they cannot save changes to it unless they know the password. This is helpful when you want colleagues to see the data but not alter it, or when you want to prevent accidental edits. Someone with the modifying password can still copy data out of the file or take screenshots, so this is not a security measure — it is a safeguard against unintended changes.
You can set both passwords on the same file. In that case, someone trying to open it will first need the opening password, and if they want to make changes, they will need the modifying password as well. Many people set only one or the other depending on their situation.
How to change or remove a password
If you need to change a password you have already set, open the file (you will need to enter the current password), then go to File > Save As again. Click Tools (Windows) or Options (Mac) and select General Options. The password fields will be empty or show dots. Clear any existing password and type the new one, or leave the field blank to remove the password entirely.
If you have set a modifying password and want to remove only that one while keeping the opening password, you can do so in the same dialog. Just clear the modifying password field and leave the opening password field as it is. Click OK, confirm the opening password when prompted, and then save the file.
If you forget a password, Excel has no built-in recovery option. You cannot reset it or bypass it through the program itself. Your only options are to contact Microsoft support (which may not be able to help) or use a third-party password recovery tool, which may or may not work depending on the version of Excel and the strength of the password.
Password protection in different versions of Excel
The steps above work in Excel 2016 and later on both Windows and Mac. If you are using an older version of Excel, the menu path may be slightly different — older versions sometimes label the button Save Options instead of Tools, or the dialog may appear in a different location. The core idea is the same: look for a Tools or Options button in the Save As dialog.
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 that lives in OneDrive or SharePoint, you must read it to your computer, add the password in the desktop version of Excel, and then upload it again. Alternatively, you can password-protect the OneDrive or SharePoint folder itself, which restricts access to anyone who does not have permission to view that folder.
If you use Google Sheets instead of Excel, the process is different — Google Sheets does not support file-level passwords, but you can restrict who can view or edit the spreadsheet by changing the sharing settings.
What password protection does and does not do
A password on an Excel file prevents someone from opening it or editing it without the correct password. It does not encrypt the file in a way that makes it unreadable if someone gains access to your computer or email account. If someone with technical knowledge obtains the file, they may be able to remove the password using specialized tools, though this is more difficult with newer versions of Excel than older ones.
Password protection is useful for preventing accidental changes, keeping casual viewers out, and meeting basic security requirements in a workplace. It is not suitable for protecting highly sensitive data like financial records, medical information, or trade secrets — for that level of security, you need full-disk encryption or a dedicated find file storage system.
If you share the file with someone and give them the password, they can make a copy of the file without the password and share it with others. The password only protects the specific file you created, not the data inside it once someone has access.
Protecting specific cells or sheets instead of the whole file
Sometimes you do not need to lock the entire file — you just want to prevent changes to certain cells or sheets. Excel lets you do this without a password, or with a password if you prefer. To protect a sheet, go to Review (or Tools on Mac), click Protect Sheet, and choose which actions you want to allow or block. You can optionally set a password here, which means someone would need that password to unprotect the sheet.
To protect specific cells, first select the cells you want to lock, then go to Format > Cells and check the Locked option. Then protect the sheet as described above — only the locked cells will be protected when the sheet is protected. Unlocked cells can still be edited by anyone.
Sheet and cell protection is lighter-weight than file-level password protection. It is useful when you want to let people edit certain parts of a spreadsheet but not others, or when you want to prevent accidental changes to formulas or headers. Like file-level passwords, it is not a security measure — someone determined to edit a protected sheet can usually do so with the right tools.
Frequently Asked Questions
What happens if I forget my Excel password?
Excel does not have a password recovery feature built into the program. If you forget the password, you cannot open or modify the file through normal means. You can contact Microsoft support, though they may not be able to help. Some third-party password recovery tools exist, but they do not work on all versions of Excel and may not work on newer files.
Can I password-protect an Excel file on my phone or tablet?
The mobile versions of Excel (on iPhone, iPad, or Android) do not have a built-in password protection feature. You must use the desktop version of Excel on Windows or Mac to add a password. Once the password is set, you can open the protected file on your phone or tablet, but you will need to enter the password first.
Does password-protecting an Excel file make it encrypted?
Password protection and encryption are not the same thing. A password on an Excel file prevents someone from opening it without the correct password, but the file itself is not encrypted in a way that makes it unreadable if someone gains access to your computer. For true encryption, you need to use full-disk encryption or a dedicated find file storage system.
Can I share a password-protected Excel file with someone and change the password later?
Yes. You can change or remove the password at any time by opening the file, going to File > Save As, and updating the password in the General Options dialog. The person you shared it with will still have their copy of the file with the old password, but new copies you share will use the new password.
What is the difference between protecting a sheet and protecting a file?
Protecting a file with a password prevents anyone from opening it or editing it without the password. Protecting a sheet prevents changes to specific cells or the sheet structure, but the file itself can still be opened. Sheet protection is useful when you want to let people view and edit certain parts of a spreadsheet but not others.