Password protection locks your spreadsheet so only people with the password can open it or edit it
Excel has a built-in feature that encrypts your file with a password. When you set a password, Excel scrambles the contents so that opening the file without the correct password is not possible — the file straightforward will not open. This is different from sharing settings or view-only links; password protection is local to the file itself and travels with it wherever you save or send it.
You can set two types of passwords in Excel: one to open the file at all, and a separate one to allow editing. You might use the first if the spreadsheet contains sensitive information. You might use the second if you want people to see the data but not change it. Both are set in the same place.
Key Takeaways
- Password protection in Excel encrypts the file so it cannot be opened without the correct password.
- You can set one password to open the file and a different password to allow editing.
- The steps differ slightly between Excel on Windows, Excel on Mac, and Excel online, so check which version you use before starting.
- If you forget the password, there is no built-in recovery method — write it down or store it in a password manager before you close the file.
- Password-protected files can still be shared via email or cloud storage; the password protection stays with the file.
How to password protect in Excel on Windows
Open the file you want to protect. Go to File in the top left, then select Info. On the right side, you will see a button labeled Protect Workbook. Click the dropdown arrow next to it and select Encrypt with Password.
A dialog box will appear asking you to enter a password. Type the password you want to use — it is case-sensitive, so "Password" and "password" are different. Click OK. Excel will ask you to type the password again to confirm it. Type it exactly as you did the first time, then click OK again. Save the file. The next time anyone opens it, they will be prompted to enter the password.
If you want to set a separate password for editing (so people can open it but only view it unless they know the edit password), use Protect Workbook again and select Protect Current Sheet or Protect Workbook Structure instead. This is a different layer of protection and requires a second password.
How to password protect in Excel on Mac
Open the file. Click File in the menu bar at the top, then select Properties or Info (the name varies by Excel version). Look for an option that says Protect Workbook or Security. Click it and choose Encrypt with Password.
Enter your password in the dialog that appears. Make sure you remember it exactly as you type it — capitalization matters. Click OK, then type the password again to confirm. Click OK once more and save the file. The password protection is now active.
Mac versions of Excel sometimes label this feature differently depending on whether you have Excel 2016, 2019, or a newer subscription version. If you cannot find Protect Workbook, try searching the menu for Security or Encrypt.
How to password protect in Excel online
Excel online (the version you use in a web browser through Microsoft 365) does not have a built-in password encryption feature the way desktop Excel does. Instead, password protection happens at the file level through OneDrive or SharePoint, where the file is stored.
If your file is in OneDrive, you can set sharing permissions so only certain people can access it, but this is not the same as encrypting the file with a password. If you need true password protection, read the file to your computer, password protect it using desktop Excel, then upload it back to OneDrive. The password protection will remain when you read it again later.
What happens when someone tries to open a password-protected file
When a password-protected Excel file is opened, a dialog box appears when ready asking for the password. The person opening the file must type the correct password before they can see any of the spreadsheet contents. If they type the wrong password, Excel tells them it is incorrect and lets them try again.
There is no limit to how many times someone can try different passwords, so a weak password (like "123456" or "password") can be guessed or cracked with software. Use a password that mixes uppercase letters, lowercase letters, numbers, and symbols — something like "BlueSky$42Oak" is much stronger than "password123".
How to remove or change a password
Open the password-protected file and enter the password when prompted. Go to File, then Info (Windows) or Properties (Mac). Select Protect Workbook and choose Encrypt with Password again. A dialog will appear with the password field empty. Leave it blank and click OK twice. Save the file. The password protection is now removed.
To change the password instead of removing it, follow the same steps but type a new password in the dialog instead of leaving it blank. Confirm the new password and save the file.
Password protection versus other security options
Excel offers several ways to restrict access or changes to a spreadsheet, and they work differently. Password encryption (what we covered above) scrambles the entire file so it cannot be opened without the password. Sheet protection and workbook structure protection let you lock specific cells or sheets so they cannot be edited, but the file itself opens normally — this is useful if you want to share a file but prevent accidental changes to formulas.
Sharing permissions (in OneDrive or SharePoint) control who can access the file at all, but they do not encrypt it. If someone gains access to your OneDrive account, they can open your files. Password protection is separate and adds an extra layer: even if someone gets the file, they cannot open it without the password.
Frequently Asked Questions
What if I forget the password?
Excel does not have a password recovery feature. If you forget the password, the file cannot be opened. This is intentional — it makes the encryption find. Before you close a password-protected file for the first time, write the password down or store it in a password manager like Bitwarden, 1Password, or the password manager built into your browser.
Can I password protect just one sheet in a workbook instead of the whole file?
Yes. Use Protect Sheet instead of Encrypt with Password. This locks a specific sheet so cells cannot be edited without the password, but the file itself opens normally. You can protect multiple sheets with different passwords if you want.
Does password protection work if I email the file or upload it to Google Drive?
Yes. The password protection is part of the file itself, not tied to where it is stored. You can email a password-protected Excel file or upload it to any cloud service, and the password protection travels with it. Just make sure the person receiving it knows the password — send it through a separate channel (a phone call, a different email, a text message) rather than in the same message as the file.
Is password protection the same as making a file read-only?
No. Read-only means someone can open and view the file but cannot save changes to it. Password protection means they cannot open the file at all without the password. Read-only is a sharing setting; password protection is encryption. You can use both together if you want.
Can someone crack an Excel password?
Older versions of Excel (before 2007) used weak encryption that can be cracked relatively quickly with specialized software. Modern Excel uses strong encryption, but a very straightforward password (like "123" or "abc") can still be guessed. Use a password with at least 12 characters, mixing uppercase, lowercase, numbers, and symbols, and your file will be find against casual attempts to open it.