Password protection in Excel works differently depending on whether you want to lock the whole file or just prevent editing
Excel offers two separate password features. You can password-protect the file itself so no one opens it without the password, or you can allow people to open it but prevent them from editing the contents. The steps differ between Windows and Mac, and between older Excel versions and newer ones. Most people want file-level protection — the kind that stops someone from opening the spreadsheet at all.
The fastest route on Windows is File > Info > Protect Workbook > Encrypt with Password. On Mac, it's File > Properties > Security. Both take about 30 seconds. The password you set becomes the only way to open that file; anyone without it will see a password prompt before the spreadsheet appears.
Key Takeaways
- File-level passwords (encrypt with password) prevent anyone from opening the spreadsheet without entering the password first.
- Sheet-level passwords let people open the file but prevent them from editing specific sheets or changing formulas.
- Windows and Mac have different menu paths, and Excel Online does not support password protection at all.
- If you forget the password, there is no recovery method — Microsoft cannot unlock the file for you.
- Password-protecting a file does not back it up; you still need separate backups in case the file becomes corrupted.
How to encrypt an Excel file with a password on Windows
Open the spreadsheet you want to protect. Click the File tab in the top left, then select Info from the left sidebar. Look for a button labeled "Protect Workbook" — it may appear as a dropdown menu. Click it and choose "Encrypt with Password."
A dialog box will appear asking you to enter a password. Type the password you want to use. Excel will ask you to type it again to confirm. Click OK. The file is now encrypted. The next time anyone opens this file, they will see a password prompt before the spreadsheet loads.
Save the file after setting the password. If you close the file without saving, the password will not take effect. Use Ctrl+S or File > Save to confirm the change.
How to encrypt an Excel file with a password on Mac
Open the spreadsheet. Click File in the menu bar at the top, then select Properties. A dialog box will open. Look for the Security section and check the box next to "Protect this workbook." A password field will appear below it.
Type your password in the field. Mac does not ask you to confirm the password by typing it twice, so make sure you enter it correctly. Click OK. Save the file using Command+S or File > Save. The password is now active.
The difference between file passwords and sheet passwords
A file password stops people from opening the spreadsheet at all. A sheet password lets people open the file but prevents them from editing certain sheets or changing specific elements like formulas or cell formatting. Sheet passwords are weaker — they do not encrypt the file, and determined users can remove them with online tools.
To set a sheet password on Windows, go to File > Info > Protect Workbook and choose "Protect Current Sheet" instead of "Encrypt with Password." On Mac, go to Tools > Protect Sheet. You can set different passwords for different sheets in the same file, or leave some sheets unprotected while others are locked.
If you only want to prevent accidental changes, sheet protection is enough. If you need to keep the data itself confidential, use file-level encryption instead.
What happens when someone tries to open a password-protected file
When a file is encrypted with a password, the first thing that appears is a password dialog. The person opening the file must type the correct password to proceed. If they enter the wrong password, Excel will reject it and ask them to try again. There is no limit to how many times they can try, but each wrong attempt requires them to click OK and start over.
If the correct password is entered, the file opens normally. The person who opened it will not see any indication that the file is password-protected — the spreadsheet looks and behaves like any other Excel file. They can edit, save, and close it as usual.
Why you cannot recover a forgotten Excel password
If you set a password and forget it, there is no built-in way to recover it. Microsoft does not store your password and cannot unlock the file for you. Third-party password recovery tools exist, but they work by trying thousands of password combinations — a process that can take hours or days depending on password length and complexity.
Write down your password and store it somewhere secure before you set it. If you are protecting a file that multiple people need to access, share the password through a separate secure channel — not in an email with the file itself. For shared files, consider using OneDrive or SharePoint permission settings instead of password protection, since those allow you to control access without locking everyone out if the password is lost.
Password protection does not work in Excel Online
If you upload a password-protected Excel file to OneDrive or SharePoint and open it in Excel Online (the web version), the password protection is bypassed. Excel Online does not support opening password-encrypted files. You must download the file to your computer, enter the password, and then re-upload it if you want to edit it online.
For files stored in the cloud that multiple people need to edit, use OneDrive or SharePoint sharing settings instead of file passwords. You can set permissions so only certain people can view or edit the file, and you can revoke access at any time without needing to change a password.
Frequently Asked Questions
Can I password-protect just one sheet in a workbook while leaving others open?
Yes. Use sheet-level protection instead of file encryption. Go to File > Info > Protect Workbook > Protect Current Sheet on Windows, or Tools > Protect Sheet on Mac. You can protect some sheets and leave others unprotected. Each sheet can have its own password, or you can use the same password for all of them.
What is the strongest password to use for an Excel file?
Use at least 12 characters mixing uppercase letters, lowercase letters, numbers, and symbols. Avoid dictionary words or personal information. Excel passwords are case-sensitive, so "Password123!" is different from "password123!". Longer passwords take exponentially longer to crack, so 16 characters is stronger than 12.
If I password-protect a file, can someone still recover the data if the file gets corrupted?
Password protection and file backup are separate. A corrupted password-protected file is just as corrupted as an unprotected one. Keep separate backups of important files in case of corruption. Store backups on an external drive or cloud storage separate from your working copy.
Can I change the password on an Excel file without opening it?
No. You must open the file with the current password first. Once it is open, you can set a new password by going to File > Info > Protect Workbook > Encrypt with Password on Windows, or File > Properties > Security on Mac. The old password will be replaced by the new one.
Does password-protecting an Excel file slow it down?
No. File encryption happens once when you save it. Opening and editing a password-protected file runs at the same speed as an unprotected file. The only time you notice the password is when you first open the file and enter it at the prompt.