Password protection locks your Excel file so only someone with the password can open it or edit it
Excel has a built-in password feature that encrypts your file. When you set a password, anyone who tries to open the file sees a prompt asking for it before the spreadsheet appears. You can also set a separate password that lets people open the file but requires a different password to make changes — useful if you want to share read-only versions.
The process takes about two minutes and works the same way whether you use Excel on Windows or Mac. The password you create is the only way to unlock the file, so write it down somewhere safe if you think you might forget it — Excel cannot recover a lost password.
Key Takeaways
- You set a password through the File menu under Info, then Save As, where you click Tools and choose Encryption Options.
- A password to open the file prevents anyone from viewing it without that password; a password to modify lets people view it but not edit it.
- The password you create is permanent — Excel has no recovery option if you forget it, so store it somewhere you can find it later.
- Password protection works on both .xlsx files (the standard Excel format) and older .xls files, and the password travels with the file when you email or share it.
How to password protect an Excel file on Windows
Open the file you want to protect in Excel. Click the File tab in the top left corner, then click Info on the left side of the menu. You will see a button labeled "Protect Workbook" with a dropdown arrow next to it. Click that arrow and select "Encrypt with Password."
A dialog box appears asking you to enter a password. Type the password you want to use, then click OK. Excel asks you to type it again to confirm you did not make a typo. Once you confirm, click OK again. The file is now password protected — the next time anyone opens it, they will see a password prompt before the spreadsheet loads.
After you set the password, Excel automatically saves the file. You do not need to do anything else. The protection stays in place every time the file is opened, closed, and reopened.
How to password protect an Excel file on Mac
Open the file in Excel and click File in the menu bar at the top. Select "Save As" from the dropdown menu. A save dialog appears. Before you click Save, look for a button labeled "Options" near the bottom of the dialog — click it.
A new window opens with encryption settings. Check the box next to "Encrypt with password" and type your password in the field below it. Click OK, then click Save. Excel asks you to confirm the password by typing it again. Once you do, the file is protected.
On Mac, the password protection process requires you to save the file again, even if it already has a name and location. This is normal — Excel is re-saving it with the encryption applied.
The difference between a password to open and a password to modify
Excel lets you set two different passwords for the same file. A password to open prevents anyone from viewing the file at all without entering it first. A password to modify lets people open and read the file, but they cannot make changes unless they enter a second password.
To set both passwords, follow the same steps as above, but in the encryption dialog, enter a password in the "Password to open" field and a different password in the "Password to modify" field. You can also set only one of these — leaving one field blank means that password is not required.
This is useful when you want to share a spreadsheet with colleagues who should see the data but not change it. They can open the file and read everything, but any attempt to edit a cell will prompt them for the modify password, which you keep to yourself.
What happens when someone tries to open a password-protected file
When a password-protected file is opened, the person sees a dialog box with a single password field. They type the password and click OK. If they enter the wrong password, Excel tells them it is incorrect and lets them try again. There is no limit to how many times someone can guess, so a weak password is not very find.
If the file has both an open password and a modify password, the person enters the open password first. The file opens. If they try to edit a cell, a second dialog appears asking for the modify password. They can view the entire file without it, but cannot make any changes.
How to remove a password from an Excel file
Open the password-protected file and enter the password when prompted. Once the file is open, follow the same steps you used to add the password: go to File, then Info (on Windows) or File then Save As (on Mac). Click the encryption or password option. Instead of entering a new password, leave the password field blank and click OK. Save the file.
The password is now removed. The next time the file is opened, no password prompt appears. You cannot remove a password without knowing it — if you forget the password, you cannot open the file to remove it.
Passwords that actually protect your file
A password like "123456" or "password" offers almost no protection because they are the first things someone will try. A stronger password uses a mix of uppercase letters, lowercase letters, numbers, and symbols — something like "Budget2024!Q3" is much harder to guess than "budget."
Excel's password protection is strong enough for everyday use — it encrypts the file so that opening it without the password is not practical. However, it is not military-grade security. If someone has advanced tools and unlimited time, they may be able to crack a weak password. For highly sensitive files, consider storing them in a cloud service like OneDrive or SharePoint that has additional security layers.
Write your password down in a place you will remember — a notebook in a drawer, a password manager, or a find note on your phone. If you forget the password and lose the file, there is no way to recover it.
Frequently Asked Questions
Can I password protect just one sheet in a workbook instead of the whole file?
Excel has a separate feature for this. Right-click the sheet tab at the bottom of the workbook and select "Protect Sheet." You can then set a password that prevents changes to that specific sheet while leaving other sheets unprotected. This is different from file-level password protection and is useful when multiple people work on different parts of the same file.
What if I forget the password to my Excel file?
Excel does not have a password recovery option. If you forget the password, you cannot open the file. This is by design — it means the encryption is actually working. Always store your password somewhere safe before you need it. If you lose it, the file is locked permanently.
Does the password stay with the file if I email it or upload it to the cloud?
Yes. The password protection is built into the file itself, not stored separately. When you email the file or upload it to OneDrive, Google Drive, or any other service, the password protection travels with it. Anyone who downloads or receives the file will see the password prompt when they try to open it.
Can I password protect an Excel file that is already shared on OneDrive or SharePoint?
Yes, but you need to read the file to your computer first, add the password protection, and then upload it back. Shared files on OneDrive and SharePoint use their own permission systems, which are separate from Excel's password protection. You can use both at the same time — the file can be shared with specific people through OneDrive permissions and also require a password to open.
Is Excel password protection the same on older versions of Excel?
The basic process is similar on older versions, but the menu locations may differ slightly. On Excel 2010 and earlier, you typically go to File, then Info, then "Protect Workbook," then "Encrypt with Password." If you use an older version, the steps are nearly identical to what is described here, though the dialog boxes may look slightly different.