Password protection works differently depending on your Excel version
Excel lets you lock a file so that anyone opening it must enter a password first. The steps differ slightly between Excel on Windows, Excel on Mac, and Excel Online. Windows and Mac versions let you set a password that prevents opening the file at all. Excel Online (the free version in your browser) can only password-protect the file if it's stored in OneDrive or SharePoint, and the protection happens at the folder level rather than the file level.
This guide covers the desktop versions, which give you the most control. If you use Excel Online, you'll need to move the file to OneDrive and set sharing permissions instead — that's a different process covered in Microsoft's OneDrive help.
Key Takeaways
- On Windows and Mac, go to File > Info > Protect Workbook and choose "Encrypt with Password" to lock the entire file.
- Your password must be entered exactly as typed — uppercase and lowercase letters matter — so write it down somewhere safe.
- If you forget the password, Microsoft cannot recover it, and the file becomes permanently inaccessible.
- Password protection encrypts the file, so even if someone copies it, they cannot open it without the correct password.
How to password-protect an Excel file on Windows
Open the file you want to protect in Excel. Click the File tab in the top left corner. From the menu on the left, select Info. You'll see a button labeled Protect Workbook with a dropdown arrow next to it. Click that dropdown and choose Encrypt with Password.
A dialog box will appear asking you to enter a password. Type your password in the field. Excel will not show you what you're typing — it displays dots or asterisks instead. Click OK. Excel will ask you to enter the password again to confirm you typed it correctly. Type it a second time and click OK. Save the file. The next time anyone opens this file, they will be prompted to enter the password before the spreadsheet appears.
How to password-protect an Excel file on Mac
Open the file in Excel. Click File in the menu bar at the top. Select Info from the dropdown. Look for the button that says Protect Workbook and click the dropdown arrow next to it. Choose Encrypt with Password.
A dialog will open asking for your password. Type it in the field — you won't see the characters as you type. Click OK. Excel will ask you to enter the password a second time to make sure you typed it correctly. Enter it again and click OK. Save the file using Command + S or by going to File > Save. The password protection is now active.
What happens when someone tries to open a password-protected file
When another person (or you, on a different computer) tries to open the file, Excel will display a password prompt before the spreadsheet loads. They must enter the exact password to proceed. If they enter the wrong password, they'll see an error message and can try again. There's no limit to how many times they can attempt to enter the password.
The password is case-sensitive, meaning "MyPassword" is different from "mypassword". If someone enters the password correctly, the file opens normally and they can edit it, save it, and share it — unless you've also set other restrictions like sheet protection or workbook protection, which are separate features.
How to remove a password from an Excel file
If you want to remove password protection later, open the file and enter the password when prompted. Go to File > Info > Protect Workbook > Encrypt with Password. The password field will be empty (or show asterisks). Leave it blank and click OK. When prompted to confirm, leave the field blank again and click OK. Save the file. The password protection is now removed.
You must know the current password to remove it. If you've forgotten the password, you cannot remove it or open the file through Excel's built-in tools.
Important limits and things to know
Password protection encrypts the file, so the data inside is scrambled until someone enters the correct password. This is different from sheet protection, which prevents editing within a sheet but doesn't lock the file itself. You can use both at the same time if you want to lock the file and also prevent changes to specific sheets.
If you forget your password, Microsoft cannot recover it. The file will be permanently inaccessible. There is no "forgot password" recovery option for Excel file encryption. Write down your password and store it somewhere secure, or use a password manager to keep track of it.
Password protection does not prevent someone from copying the file. It only prevents them from opening it. If the file is stored on a shared drive or email, anyone with access to the file can copy it — they just can't open the copy without the password.
Frequently Asked Questions
Can I password-protect just one sheet instead of the whole file?
Yes, but that's a different feature called sheet protection. Go to the sheet tab you want to protect, right-click it, and select "Protect Sheet". You can set a password so others can't unprotect it. However, sheet protection is weaker than file encryption — it's meant to prevent accidental changes, not to secure sensitive data. To truly lock down a file, password-protect the entire file instead.
What if I share a password-protected file with someone and they change it?
Once someone opens a password-protected file with the correct password, they can save it, edit it, and share it normally. If you want to prevent them from removing the password protection, you must keep the password to yourself. There's no way to lock the password so that only you can remove it. Password protection is meant to control who can open the file, not to track changes after it's opened.
Does password protection work if I save the file as a different format, like CSV or PDF?
No. Password protection only works on Excel file formats like .xlsx and .xlsm. If you save a password-protected file as CSV, PDF, or another format, the password protection is removed and the file becomes unprotected. The data itself is still there, but anyone can open it without a password.
Can I use the same password for multiple files?
Yes, you can use the same password for as many files as you want. However, if someone learns that password, they can open all of those files. For files containing different types of sensitive information, using different passwords for each file is more secure.
Will password protection slow down my file or make it harder to use?
No. Once the file is open, password protection has no effect on performance or how the file works. You only encounter the password prompt when opening the file. After that, the spreadsheet behaves normally.