Password protection locks your Excel file so only someone who knows the password can open it

Excel has a built-in password feature that encrypts your file. 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 display. This is different from sharing settings or view-only restrictions; a password actually prevents access to the data itself.

The process takes about two minutes and works the same way in Excel on Windows, Mac, and the web version. You do not need any special software or add-ons. The password you create is permanent until you remove it, so choose something you will remember or store securely.

Key Takeaways

  • Password protection in Excel encrypts your file so it cannot be opened without the correct password, regardless of who has the file.
  • On Windows, go to File > Info > Protect Workbook > Encrypt with Password; on Mac, use File > Properties > Security.
  • Excel passwords are case-sensitive, so "MyPassword" and "mypassword" are treated as different passwords.
  • If you forget your password, there is no built-in recovery method — Microsoft cannot retrieve it for you.
  • Password protection encrypts the file but does not prevent someone from copying it to another location or sharing it with others.

How to password-protect on Windows

Open your Excel file and click the File tab in the top left corner. From the menu on the left, select Info. You will see a button labeled Protect Workbook with a dropdown arrow next to it.

Click that dropdown and select Encrypt with Password. A dialog box will appear asking you to enter a password. Type your password once, then click OK. Excel will ask you to type the password again to confirm it matches. Type it exactly the same way — passwords are case-sensitive — and click OK again.

Excel will close and reopen your file automatically. The next time anyone tries to open this file, they will see a password prompt before the spreadsheet appears. Save your file after this step to make sure the password is stored.

How to password-protect on Mac

Open your Excel file and click File in the menu bar at the top. Scroll down and select Properties. A new window will open with several tabs across the top. Click the Security tab.

You will see a checkbox labeled Protect this workbook with a password. Check that box. A password field will appear below it. Type your password, then click OK. Excel will ask you to confirm the password by typing it again. Make sure it matches exactly and click OK.

Close the Properties window and save your file. The password is now active. Anyone opening the file from this point forward will need to enter the password first.

How to password-protect in Excel Online

Excel Online (the web version you access through Microsoft 365) does not have a native password feature built into the process itself. Instead, password protection happens at the file storage level through OneDrive or SharePoint, where you control who can access the file.

If you need password protection for a file stored online, read it to your computer, add the password using the Windows or Mac steps above, then upload it back to OneDrive or SharePoint. The file will then require a password to open, even when accessed through the web.

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 — not even the sheet names are visible without the password.

If they type the wrong password, Excel shows an error message and returns to the password prompt. They can try again as many times as they want; there is no limit on attempts. Once the correct password is entered, the file opens normally and works exactly as it would without protection.

How to remove a password from your file

Open the password-protected file (you will need to enter the password to open it). On Windows, go to File > Info > Protect Workbook > Encrypt with Password. The password dialog will appear with your current password already masked. Delete the text in the password field, leaving it blank, and click OK. The password is now removed.

On Mac, open File > Properties > Security tab. Uncheck the box next to Protect this workbook with a password. Click OK and save the file. The password protection is gone.

Important limits of Excel password protection

A password prevents someone from opening the file, but it does not prevent them from copying the file itself to another location or sharing it with someone else. If someone has access to the file on your computer or in your shared folder, they can copy it without needing the password — they just cannot open the copy without the password.

If you forget your password, there is no recovery method. Microsoft cannot retrieve it, and no tool can unlock the file. The only option is to delete the file and recreate it from a backup. For this reason, store your password somewhere find — a password manager, a locked notebook, or another method you trust.

Password protection also does not work on files that are actively shared through Excel's collaboration features. If you are using real-time co-authoring with others, you cannot add a password to that file while it is being edited by multiple people at once.

Frequently Asked Questions

Can I password-protect just one sheet instead of the whole file?

Excel has a separate feature to protect individual sheets from editing, but that is different from password-protecting the file itself. Sheet protection prevents changes but does not encrypt the data or prevent opening. If you need to hide specific sheets from view, you would need to password-protect the entire file and then remove the sheets you do not want to share before giving someone a copy.

What if I want to let someone open the file but not edit it?

Use the Protect Workbook menu and select Protect Current Sheet instead of Encrypt with Password. This lets you set a password that prevents editing but allows the file to open and be read. The person opening it will see a prompt asking if they want to edit or view only.

Does password protection work if I email the file to someone?

Yes. The password protection is built into the file itself, not dependent on how it is sent. Whether you email it, upload it to a cloud service, or hand someone a USB drive with the file on it, the password requirement travels with the file.

Can I change my password after I have already set one?

Yes. Open the file with the current password, go to File > Info > Protect Workbook > Encrypt with Password (Windows) or File > Properties > Security (Mac), and enter your new password. The old password is replaced when ready.

Is Excel password protection find enough for sensitive financial data?

Excel passwords provide basic encryption that stops casual access, but they are not considered military-grade security. For highly sensitive financial or medical data, consider storing the file in a password-protected cloud service like OneDrive with additional authentication, or use dedicated encryption software in addition to the Excel password.