To require a password to open an Excel file, select File > Info > Protect Workbook > Encrypt with Password. Type a password, select OK, type it again, and select OK. Save and close the workbook. Excel asks for the password every time the file opens.
Write the password down somewhere safe first. Microsoft can’t recover a forgotten password, so if you lose it, you won’t be able to open the file.
Applies to: Excel for Microsoft 365, Excel 2024, 2021, and 2019 on Windows. Mac and Excel for the web notes are below. Checked against Microsoft Support on September 24, 2026.
Add a password to open the workbook
- Open the workbook and select File.
- Select Info.
- Select Protect Workbook, then Encrypt with Password.
- Type a password and select OK. Passwords are case-sensitive.
- Type the same password again and select OK.
- Save the workbook (Ctrl + S) and close it.

The Protect Workbook box turns yellow and says a password is required to open this workbook. Open the file again to check that Excel asks for the password.
Use a long password that’s hard to guess, such as a short phrase, and don’t reuse one from your email or bank.
Let people open it but not change it
If you want others to read the file but only let people with a password edit it:
- Select File > Save As, then More options (or Browse).
- In the Save As window, select Tools > General Options.
- Type a password in Password to modify. Leave Password to open blank, or fill it in too if you want both.
- Select OK, confirm the password, and select Save.
Anyone without the modify password can still open the file as Read Only. You can also check Read-only recommended to suggest opening it read-only without a password. This is a light safeguard, not real security, because people can save a copy under a new name and edit that. If you receive a workbook like this and need to edit it, see how to change read-only mode in Excel.
Remove the password
- Open the workbook with its password.
- Select File > Info > Protect Workbook > Encrypt with Password.
- Delete the dots in the Password box so it’s empty, and select OK.
- Save the workbook.
See how to remove encryption from an Excel file for more detail.
Password to open vs. protecting a sheet
- Encrypt with Password stops anyone without the password from opening the file at all. The contents are encrypted.
- Protect Sheet (on the Review tab) stops people changing locked cells. Anyone can still open and read the file. See how to protect a sheet in Excel.
- Protect Workbook (on the Review tab) stops people adding, deleting, renaming, or moving sheets. It doesn’t stop anyone opening the file.
On a Mac or in Excel for the web
- Excel for Mac: select File > Passwords, type a Password to open, and select OK. Confirm it and save the file.
- Excel for the web: you can’t add a password to open. Files that already have one can’t be opened in the browser, so open them in the Excel desktop app instead.
Encrypted workbooks also can’t be co-authored, so other people can’t edit them with you at the same time. For shared work, limit access with OneDrive or SharePoint sharing instead.
Frequently asked questions
I forgot the password. Can Microsoft help?
No. Microsoft can’t recover or reset a password on an Excel file. If you have an older, unprotected copy or a backup, use that. Be cautious with “password recovery” tools, which often don’t work on modern encryption and can carry malware.
Is a password-protected Excel file secure enough for sensitive data?
It’s strong for keeping people out of a file you email or store, as long as the password is long and shared separately, such as by phone. For ongoing sharing inside a team, OneDrive or SharePoint permissions are easier to manage.
Does this also protect a CSV file?
No. Only Excel workbook formats such as .xlsx can be encrypted. A CSV file saves as plain text with no password.
To lock a whole folder instead of one workbook, see how to password protect a folder in Windows 10. More help is on our Excel Help & Guides page. Microsoft’s guide is Protect an Excel file.
Related: How to share an Excel file as a link.

Matt Jacobs has been working as an IT consultant for small businesses since receiving his Master’s degree in 2003. While he still does some consulting work, his primary focus now is on creating technology support content for SupportYourTech.com.
His work can be found on many websites and focuses on topics such as Microsoft Office, Apple devices, Android devices, Photoshop, and more.