Password protection locks your Excel file so it cannot be opened without the correct password
When you password-protect an Excel document, Windows or Mac encrypts the file. Anyone who tries to open it sees a password prompt before the spreadsheet appears. Without the correct password, the file remains unreadable — even if someone copies it to their own computer.
This works on Excel files (.xlsx), older Excel formats (.xls), and files saved in other spreadsheet programs that Excel can open. The process takes about one minute and requires only the password you choose. You do not need special software or an internet connection.
Password protection is different from sharing permissions. Sharing permissions let you control who can view or edit a file you have uploaded to OneDrive or SharePoint. Password protection encrypts the file itself, so it stays locked even if someone gains access to the file through your computer or email.
Key Takeaways
- Open the file you want to protect, go to File menu, then select Save As, and choose a location to save the file.
- Click the Tools button (or gear icon) in the Save As dialog, then select General Options to see the password fields.
- Enter your password in the "Password to open" field if you want to lock the file completely, or use "Password to modify" if you want people to view it without editing.
- Save the file with your new password — from that point forward, anyone opening it will need to enter the password first.
- Write your password down somewhere safe outside your computer, because Excel cannot recover a forgotten password.
How to add a password in Excel on Windows
Open the Excel file you want to protect. Click the File menu in the top left corner, then select Save As from the left sidebar. Choose where you want to save the file — you can keep it in the same folder or pick a new one. The file will save with a new copy that has the password, so your original remains unchanged until you delete it.
In the Save As dialog, look for a Tools button near the bottom right (it may look like a wrench or gear icon). Click it and select General Options from the dropdown menu. You will see two password fields: "Password to open" and "Password to modify."
If you use "Password to open," anyone who tries to open the file must type the correct password first. If you use only "Password to modify," people can open the file without a password but cannot make changes unless they enter the password. You can use both passwords on the same file — one to open it and a different one to edit it. Type your password in whichever field you choose, then click OK.
Excel will ask you to type the password again to confirm it. Type it exactly the same way (passwords are case-sensitive, so "MyPassword" is different from "mypassword"). Click OK, then click Save in the Save As dialog. Your file is now password-protected.
How to add a password in Excel on Mac
Open the file you want to protect. Click File in the menu bar at the top, then select Save As. Choose a location and name for the file. In the Save As dialog, look for a button that says Tools or Options — on Mac it is usually near the bottom of the dialog.
Click that button and select "Set Password" or "General Options" depending on your Excel version. You will see a field for "Password to open" and sometimes a field for "Password to modify." Enter your password in the field you want to use. Click OK, then type the password again to confirm it.
Click Save. Your file now requires a password to open. The next time anyone (including you) tries to open this file, Excel will show a password prompt before displaying the spreadsheet.
Choosing a password that is hard to guess
A strong password for an Excel file uses at least 12 characters and mixes uppercase letters, lowercase letters, numbers, and symbols. Examples: "Budget2024!Q3" or "TeamData#Nov-2024". Avoid passwords based on your name, birthdate, or common words that appear in a dictionary.
The longer and more random your password, the harder it is for someone to guess or crack it. If you use a password manager (a program that stores passwords securely), you can generate a random password and let the manager remember it for you. If you write the password down, keep the paper in a safe place separate from your computer — not on a sticky note attached to your monitor.
What happens if you forget your password
Excel does not have a "forgot password" recovery option. If you forget the password to open a file, you cannot access that file. Microsoft cannot recover it for you, and no built-in tool can unlock it.
This is by design — the encryption that protects your file from others also means no one, including Microsoft, can bypass the password. If you forget a password, your only option is to delete that file and recreate it from a backup copy (if you have one) or start over.
Before you password-protect an important file, write the password down and store it somewhere you will remember — a safe, a password manager, or a locked drawer. Test the password by closing the file and opening it again to make sure you typed it correctly.
Removing a password from an Excel file
To remove password protection, open the file and enter the password when prompted. Click File, then Save As. In the Save As dialog, click Tools and select General Options. Delete the text in the "Password to open" field (and the "Password to modify" field if you used one). Click OK, then click Save.
Excel will ask you to confirm that you want to save without a password. Click Yes. The file is now saved without password protection. Anyone can open it without entering a password.
Password protection versus file sharing permissions
Password protection and sharing permissions serve different purposes. Password protection encrypts the file itself, so it stays locked no matter where the file is or who has access to it. Sharing permissions (used when files are stored on OneDrive or SharePoint) control who can view or edit a file that is already on a shared server.
If you email an Excel file to someone, password protection is the right choice because the file travels with its encryption. If you store a file on OneDrive and want to let specific people view it, use OneDrive sharing permissions instead. You can also use both: password-protect the file and then set sharing permissions on the OneDrive folder.
Frequently Asked Questions
Can I password-protect a file that is already on OneDrive or SharePoint?
Yes. read the file to your computer, password-protect it using the steps above, then upload the protected version back to OneDrive or SharePoint. From that point forward, anyone who downloads the file will need to enter the password to open it. Sharing permissions on the folder do not override the file's password protection.
What if I want people to see the file but not change it?
Use the "Password to modify" field instead of "Password to open." People can open the file without a password, but if they try to edit it, Excel will ask for the password. They can still view and copy the data, but they cannot save changes to the original file.
Does password protection work if someone has access to my computer?
Yes. Password protection encrypts the file itself, so even if someone copies the file from your computer, they still cannot open it without the password. The encryption is built into the file, not into your computer.
Can I use the same password for multiple files?
You can, but it is not recommended. If someone learns that one password, they can open all your files. Using different passwords for different files means a compromised password only affects one file.
What if I need to edit a password-protected file regularly?
You will need to enter the password each time you open it. If you find this inconvenient, consider using OneDrive sharing permissions instead, which let you control access without entering a password every time. You can also remove the password protection temporarily, make your edits, then add it back when you are done.