Password protection locks your Excel file so that anyone trying to open it must type the correct password first
Excel has a built-in password feature that prevents others from opening your spreadsheet without permission. The process takes less than a minute and works the same way on Windows and Mac. Once you set a password, the file stays locked until someone enters it — even if they have the file itself.
This is different from protecting individual cells or sheets, which stops people from editing specific parts of a file they can already open. Password protection stops them at the door.
Key Takeaways
- You set a password through File > Info > Protect Workbook on Windows, or File > Properties on Mac.
- The password you create is the only way to open the file — write it down somewhere safe, because Excel cannot recover a lost password.
- Anyone with the password can open the file and remove the protection, so use a strong password if the file contains sensitive information.
- Password protection works on all Excel versions from 2010 onward on Windows and 2016 onward on Mac.
How to add a password on Windows
Open the Excel file you want to protect. Click the File tab in the top left corner, then click Info from the menu on the left side.
Look for the button labeled Protect Workbook (it may say "Protect Workbook" with a dropdown arrow). Click it and select Encrypt with Password from the dropdown menu. A dialog box will appear asking you to enter a password.
Type your password in the field. Excel does not show what you type — you will see dots or asterisks instead. Click OK. Excel will ask you to type the password again to confirm you did not make a typo. Type it exactly the same way and click OK.
Save the file. Use Ctrl+S or go to File > Save. The password is now active. The next time anyone tries to open this file, Excel will ask for the password before showing the spreadsheet.
How to add a password on Mac
Open the Excel file you want to protect. Click File in the top menu bar, then click Properties near the bottom of the menu.
In the Properties window, look for the section labeled Security or Protect Document. Click the checkbox next to Encrypt with password or Password to open. A dialog box will appear.
Type your password and click OK. Mac will ask you to type it again to confirm. Type it exactly the same way and click OK. Close the Properties window and save the file using Command+S.
What happens when someone tries to open a password-protected file
When anyone (including you) tries to open the file, Excel displays a password prompt before the spreadsheet appears. They must type the correct password to proceed. If they type it wrong, Excel tells them the password is incorrect and lets them try again.
There is no limit to how many times someone can try, so a weak password is not very secure. Use a password that combines uppercase letters, lowercase letters, numbers, and symbols — something like BlueSky#2024 rather than password or 123456.
How to remove or change a password
Open the file and enter the password when prompted. Go to File > Info (Windows) or File > Properties (Mac). Find the Protect Workbook or Security section and click the option to encrypt with password again.
A dialog box will appear. Leave it blank if you want to remove the password entirely, or type a new password if you want to change it. Click OK, confirm if asked, and save the file. The old password will no longer work.
Important things to know about Excel passwords
Excel passwords are case-sensitive, which means MyPassword is different from mypassword. Write down your password exactly as you created it, including capital letters in the right places.
If you forget your password, Excel cannot recover it for you. There is no "forgot password" button or recovery email. You will not be able to open the file. Some third-party tools claim to crack Excel passwords, but they are unreliable and may contain malware. The safest approach is to keep your password written down in a secure place — a physical notebook in a locked drawer, or a password manager like Bitwarden or 1Password.
Password protection encrypts the file, which means the data inside is scrambled until someone enters the correct password. This is strong protection for files you email or store in the cloud. It does not protect the file if someone has physical access to your computer and can copy it before you set the password.
Frequently Asked Questions
Can I password-protect just one sheet instead of the whole file?
Yes. Right-click the sheet tab at the bottom of Excel and select Protect Sheet. This stops people from editing that sheet, but they can still open the file. To prevent them from opening the file at all, you need to password-protect the entire workbook using the steps above.
What if I need to share the file with someone else?
You must give them the password separately — never include it in the same email as the file. You can tell them the password over the phone, through a text message, or through a different email sent a few minutes later. This way, if someone intercepts one message, they do not have both the file and the password.
Does password protection work if I save the file as a different format?
It depends on the format. Password protection works if you save as .xlsx (the standard Excel format) or .xlsm (Excel with macros). If you save as .csv, .txt, or other formats, the password protection is removed. Always save as .xlsx to keep the protection active.
Can I see if a file is password-protected before I try to open it?
No. You cannot tell from the file icon or properties whether a password is set. You only find out when you try to open it and Excel asks for the password. This is intentional — it prevents someone from knowing which files are protected just by looking at them.