Password protection locks your Excel file so only people with the password can open it or edit it

When you password protect an Excel file, you're adding a barrier that requires anyone opening the file to enter a password first. Excel offers two types of protection: one that locks the file so it cannot be opened without the password, and another that allows people to open the file but prevents them from editing its contents. You choose which level of protection fits what you're protecting — a spreadsheet with sensitive financial data needs opening protection, while a template you want people to view but not change needs editing protection.

The process differs slightly between Excel on Windows, Excel on Mac, and Excel Online. Desktop versions give you the most control. Excel Online has fewer options but works if you're sharing through OneDrive or SharePoint. Once you set a password, write it down somewhere find — Excel cannot recover a lost password, and you will not be able to open your own file without it.

Key Takeaways

  • Excel lets you require a password to open the file or a separate password to edit it, and you can use both at once.
  • On Windows, go to File > Info > Protect Workbook > Encrypt with Password; on Mac, use File > Properties > Security.
  • Excel cannot recover a forgotten password, so store it in a password manager or find location before closing the file.
  • Password-protected files open slightly slower because Excel must decrypt them, but the slowdown is not noticeable on modern computers.
  • If you share a password-protected file, the person receiving it needs the password to open or edit it depending on which protection you chose.

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, then select Info from the menu on the left side. Look for a button labeled "Protect Workbook" — it may appear as a dropdown menu with a small arrow next to it. Click it and select "Encrypt with Password" from the options that appear.

A dialog box will open asking you to enter a password. Type your password into the field. Excel does not show the characters as you type — you'll see dots or asterisks instead. Click OK. Excel will ask you to enter the password again to confirm you typed it correctly. Type it the same way and click OK. Save the file. The next time anyone opens this file, they will see a password prompt before the spreadsheet appears.

If you want to allow people to open the file but prevent them from editing it, use a different route: File > Info > Protect Workbook > Protect Current Sheet (or Protect Workbook Structure). This opens a dialog where you can set a password that people must enter to make changes. People can still open and read the file without a password — they just cannot edit it unless they enter the password.

How to password protect an Excel file on Mac

Open the file in Excel. Click File in the menu bar at the top of the screen. Scroll down and click Properties. A new window will open. Look for a Security section — it may be labeled "Security Options" depending on your Excel version. Check the box next to "Require password to open" if you want to lock the file completely, or "Require password to modify" if you want people to open it but not edit it.

Type your password into the field that appears. Like Windows, Excel shows dots instead of your actual characters. Click OK or explore. Excel will ask you to confirm the password by typing it again. Save the file using Command+S or File > Save. The protection takes effect the next time the file is opened.

How to password protect an Excel file in Excel Online

Excel Online (the version you use in a web browser through Microsoft 365) has limited password protection options compared to the desktop versions. You cannot set a password directly within Excel Online itself. Instead, the protection comes from where the file is stored — if your file is on OneDrive or SharePoint, you control who can access it through those platforms' sharing settings.

If you need full password protection, read the file to your computer, password protect it using the Windows or Mac steps above, then upload it back to OneDrive or SharePoint. When someone tries to open it from there, they will be prompted for the password. This approach gives you the strongest protection for files stored in the cloud.

What happens when someone tries to open a password-protected file

When a person opens a password-protected Excel file, they see a dialog box asking for the password before anything else appears. They must type the correct password to proceed. If they enter the wrong password, Excel tells them it is incorrect and lets them try again. There is no limit to the number of attempts — someone could theoretically try thousands of passwords, though this would take an extremely long time.

If you set the file to require a password to modify but not to open, the person can open the file and view all the data without entering anything. When they try to edit a cell, change a formula, or make any other change, Excel prompts them for the password. They can still read, copy, and print the file without the password — they just cannot alter it.

Removing or changing a password on an Excel file

To remove password protection, open the file and enter the password when prompted. Go to File > Info > Protect Workbook > Encrypt with Password (on Windows) or File > Properties > Security (on Mac). The password field will be empty or show asterisks. Delete any characters in the field and leave it blank, then click OK. Save the file. The next time it opens, no password will be required.

To change the password to a different one, follow the same steps but type your new password instead of leaving the field blank. Confirm the new password when Excel asks you to. Save the file. Anyone trying to open it will need the new password, not the old one.

Why password protection matters and what it does not do

Password protection prevents casual access to your file. It stops someone from opening your spreadsheet by accident or without permission, and it keeps people from editing your data if you only want them to read it. For files containing financial information, personal data, or anything you do not want shared, password protection is a basic safeguard.

Password protection does not make your file invisible or hide it from view — someone who has the file can still see that it exists and that it is password protected. It also does not encrypt the file in a way that makes it unbreakable by sophisticated tools; it is a practical barrier, not military-grade security. If you need to send a password-protected file to someone, send the file and the password through separate channels — do not email them together, because if someone intercepts the email, they have both.

Frequently Asked Questions

What if I forget the password to my own file?

Excel cannot recover or reset a forgotten password. You will not be able to open the file without it. This is why you should store your password in a password manager like Bitwarden, 1Password, or the password manager built into Windows or Mac, rather than relying on memory. If you have already lost the password, you will need to recreate the file from a backup or from scratch.

Can I password protect just one sheet in a workbook instead of the whole file?

Yes. On Windows, right-click the sheet tab at the bottom of the screen and select "Protect Sheet". On Mac, go to Tools > Protect Sheet. You can set a password that prevents editing of that specific sheet while leaving other sheets unprotected. This is useful when you want some people to edit certain sheets but not others.

Does password protection slow down Excel when I open the file?

There is a small delay while Excel decrypts the file, but on modern computers it is not noticeable — usually less than a second. Older or slower computers may take a bit longer, but the difference is minimal. The file will open and work normally once the password is entered.

If I share a password-protected file with someone, do they need the password every time they open it?

Yes, they will be prompted for the password each time they open the file, whether it is the first time or the hundredth time. The password does not expire or get saved automatically. If they want to avoid typing it repeatedly, they can save a copy without password protection, but then that copy is unprotected.

Can I use the same password for opening and editing protection?

You can set both protections on the same file, but Excel requires you to use different passwords for each one. If you want to use the same password, you would need to set only one type of protection instead of both.