How to Add a Password to an Excel Spreadsheet
In this article
Yes, you can add a password to an Excel spreadsheet. Open the file, go to File > Info > Protect Workbook > Encrypt with Password (or File > Info > Protect Workbook > Encrypt with Password on Mac), type a password, and save. The file will then require that password to open. This guide covers the exact steps for Excel for Microsoft 365 and Excel 2019/2021 on Windows and Mac, plus common mistakes and fixes.
What You'll Need
- Microsoft Excel installed on your computer (Windows or Mac). The steps below are for the desktop app; Excel for the web does not support adding a password to open a file.
- The spreadsheet you want to protect, saved in a modern format such as .xlsx or .xlsm. Legacy .xls files also work but may show slightly different dialogs.
- A password you will remember. Excel cannot recover a forgotten password, so store it in a password manager.
Step-by-Step
Menu labels can differ slightly by Excel version, device, and region. The paths below match current Excel for Microsoft 365 and Excel 2019/2021 on Windows; Mac steps are noted where they differ.
- Open the spreadsheet in Excel. Make sure you are editing the file you intend to protect, not a copy.
- Go to File > Info. On Windows, click File in the ribbon, then Info in the left pane. On Mac, click File in the menu bar, then Info (or Protect Workbook depending on version).
- Click Protect Workbook > Encrypt with Password. A dialog box appears asking for a password.
- Type your password and click OK. Use a strong password: at least 12 characters mixing upper and lower case, numbers, and symbols. Avoid birthdays or common words.
- Re-enter the password to confirm. Excel asks you to type it again. If the two entries do not match, you will be prompted to start over.
- Save the file. Press Ctrl+S (Windows) or Cmd+S (Mac). The password is not applied until you save. Close and reopen the file to confirm Excel prompts for the password.
To remove the password later, repeat steps 1–3, delete the dots in the password field, click OK, and save. The file will open without a prompt.
Common Mistakes
- Not saving after setting the password. If you close without saving, the password is not applied. Always save and test by reopening.
- Forgetting the password. Microsoft cannot recover it. There is no official backdoor. Keep a copy in a password manager before you save.
- Using Encrypt with Password when you meant to restrict editing. Encrypt with Password controls opening the file. To stop others from changing structure or windows, use Protect Workbook with a different option; to lock specific cells, use Review > Protect Sheet. These are separate features and can be combined.
- Assuming Excel for the web can add a password. The browser version does not offer Encrypt with Password. Open the file in the desktop app to set it.
- Sharing the password in the same email as the file. Send the password through a separate channel, such as a password manager share or a phone call.
- Protecting a read-only or shared workbook incorrectly. If the file is marked final or shared, some protection options are greyed out. Turn off Mark as Final first (File > Info > Protect Workbook > Mark as Final).
Tips
- Use a password manager to generate and store a long random password. You will rarely type it, so length matters more than memorability.
- Test the password on a copy before sending the original to anyone. Open the copy, confirm the prompt, then delete the copy.
- Combine Encrypt with Password with Review > Protect Sheet if you want to stop edits to specific cells after the file is opened. The open password and the sheet password are independent.
- If you email the file, remember that anyone with the password can open it. For sensitive data, consider a link to a protected cloud location instead of an attachment.
- Keep an unencrypted backup in a secure location in case you lose the password. Store it offline or in a vault, not next to the encrypted file.
Troubleshooting
If the password prompt does not appear, or you cannot open the file, work through these checks in order.
- Confirm you saved the file. Reopen Excel, check the file, and look for the password prompt. If it opens without a prompt, repeat the Encrypt with Password steps and save again.
- Check you are using the desktop app. Excel for the web cannot set or remove an open password. Open the file in the desktop version.
- Try the password with Caps Lock off and on. Passwords are case-sensitive. Also check your keyboard layout if you switch languages.
- Look for a protected view banner. Files downloaded from the internet open in Protected View. Click Enable Editing before entering the password.
- If the file is corrupted or will not open at all, try opening it in Excel with File > Open > Browse and selecting Open and Repair. This does not remove a password; it repairs file damage.
- If you have forgotten the password, there is no official recovery method. Restore an earlier unencrypted backup if one exists. Third-party password-removal tools exist but are not endorsed by Microsoft and may damage the file; use them only on files you own and keep a copy first.
Frequently Asked Questions
Can I add a password to an Excel file on my phone?
The Excel mobile app does not offer Encrypt with Password. Set or remove the password in the desktop app, then open the file on your phone; you will be prompted for the password when opening.
What is the difference between Encrypt with Password and Protect Sheet?
Encrypt with Password requires a password to open the file. Protect Sheet locks specific cells or features after the file is open. You can use both together.
Can Microsoft recover a forgotten Excel password?
No. Microsoft support cannot open or bypass a password-protected file. Keep the password in a password manager and maintain a secure backup.
Does adding a password change the file format?
No. The file keeps its extension (.xlsx, .xlsm, .xls), but it is encrypted. Older Excel versions may not open newer encrypted files; save a copy in a compatible format if you share with older software.
Will a password stop someone from copying the data?
It stops them from opening the file without the password. Once opened, they can copy what they can see. For stronger control, restrict editing with Protect Sheet and share only what is necessary.
Can I password-protect a CSV file?
Not directly. CSV is plain text. Open the CSV in Excel, save it as .xlsx, then apply Encrypt with Password.