Password protection locks your Excel file so only people with the password can open it
When you add a password to an Excel file, Windows or Mac encrypts the file and requires anyone who opens it to type the correct password first. This works for both .xlsx files (the standard format) and older .xls files. The password you set is the only way in — if you forget it, Microsoft cannot recover the file for you, so write it down somewhere safe before you close the file for the first time.
The steps differ slightly depending on whether you use Excel on Windows, Mac, or the web version. All three methods are straightforward and take less than a minute.
Key Takeaways
- You set a password through the "Save As" dialog, not through a separate settings menu.
- Excel on Windows and Mac both have a "General Options" or "Security Options" button that appears during Save As.
- The web version of Excel (Office.com) does not support password protection — you must use the desktop app.
- If you forget the password, the file cannot be opened or recovered, so store your password in a password manager or write it down.
- Password protection encrypts the entire file and applies every time someone opens it, whether they use Excel, Google Sheets, or another spreadsheet program.
How to password-protect Excel on Windows
Open the file you want to protect. Go to File in the top left, then click Save As. Choose where you want to save the file (your computer, OneDrive, or another location) and type the filename.
Before you click the Save button, look for a button labeled Tools near the bottom right of the Save As dialog. Click it and select General Options from the dropdown menu. A small dialog box will appear with two password fields: one for "Password to open" and one for "Password to modify."
Type your password in the "Password to open" field. This is the password people will need to enter before they can even see the file. Leave the "Password to modify" field blank unless you want a second password that lets people view the file without the password but requires a password to edit it. Click OK, then type your password again to confirm it, then click OK again. Now click Save to finish.
How to password-protect Excel on Mac
Open the file you want to protect. Click File at the top, then select Save As. Type your filename and choose where to save it.
Before you click Save, look for a checkbox labeled Protect with password near the bottom of the dialog. Check that box. A password field will appear — type your password there. Click Save, then type your password again when Mac asks you to confirm it.
On Mac, there is no separate "password to modify" option. The single password protects the file from being opened without it.
Why the web version does not support passwords
Excel Online (the version you use at Office.com or through OneDrive) does not have a built-in password protection feature. If you need to password-protect a file, you must download it to your computer, add the password using the desktop version of Excel, then upload it back to OneDrive or wherever you store it.
If you share files through OneDrive or SharePoint, you can control who has access through sharing permissions instead. That is not the same as a password — it prevents people from finding the file at all rather than requiring a password to open it — but it is the closest alternative in the web version.
What happens when someone opens a password-protected file
When another person tries to open your password-protected Excel file, they will see a dialog box asking for the password before the file opens. They type the password and click OK. If they type it wrong, they get an error message and can try again. There is no limit to how many times they can try, so a weak password is not very secure.
The password works the same way whether someone opens the file in Excel, Google Sheets, LibreOffice, or any other spreadsheet program. The encryption is built into the file itself, not into Excel.
How to change or remove a password
To change the password on an existing file, open the file (you will need to enter the current password), then go to File and click Save As. Follow the same steps as above — on Windows, click Tools and General Options; on Mac, check Protect with password. Type your new password and save the file. The old password will no longer work.
To remove the password entirely, open the file, go to Save As, and leave the password field blank (on Windows, clear both password fields in General Options; on Mac, uncheck the "Protect with password" box). Save the file. It will no longer require a password to open.
Common mistakes that lock you out of your own file
The most common mistake is forgetting the password and having no way to recover it. Excel does not store your password anywhere — it only stores an encrypted version of it. If you forget it, the file cannot be opened by anyone, including you. Before you close the file for the first time, write the password down in a password manager like Bitwarden, 1Password, or the password manager built into Windows or Mac.
Another mistake is typing the password wrong when you confirm it. If the two passwords do not match, Excel will ask you to try again. Make sure Caps Lock is off — passwords are case-sensitive, so "MyPassword" is different from "mypassword."
A third mistake is saving the file with a different name or format. If you use Save As to add a password but accidentally change the filename or save it as a different file type, you will have created a new file with a password instead of protecting the original. Always check the filename and location before you click Save.
Frequently Asked Questions
Can I password-protect just one sheet in a workbook instead of the whole file?
No, password protection in Excel locks the entire file. If you want to protect only certain sheets, you can use sheet protection instead — go to Review (or Tools on Mac), click Protect Sheet, and set a password. Sheet protection prevents people from editing specific sheets but does not prevent them from opening the file.
Is a password strong enough to keep my file secure?
Excel's password encryption is reasonably secure for everyday use, but a weak password (like "123456" or "password") can be cracked with enough time and computing power. Use a password that is at least 12 characters long and includes uppercase letters, lowercase letters, numbers, and symbols for better security.
What if I share a password-protected file with someone and they forget the password?
They will not be able to open the file. There is no way to recover or reset the password — you would need to remove the password from your copy, then send them the unprotected version. This is why it is important to share the password through a separate, secure channel (like a phone call or password manager) rather than in an email with the file.
Does password protection work if I save the file as a PDF or CSV?
No. Password protection is specific to Excel files. If you save a password-protected .xlsx file as a PDF or CSV, the password is lost and the new file has no protection. You would need to add a new password to the PDF or CSV using a different tool.
Can I open a password-protected Excel file in Google Sheets?
Google Sheets will ask for the password when you try to upload or open the file. Once you enter the correct password, Google Sheets can read the file. However, if you download it back from Google Sheets, it will no longer have password protection unless you add it again using Excel.