The quickest way to password protect an Excel file

To password protect an Excel file, open the file in Excel, then go to File > Info > Protect Workbook > Encrypt with Password. Type your password twice and click OK. Save the file. The next time anyone opens it, they will be asked for the password before they can see any content.

This method encrypts the entire file, meaning someone cannot open it at all without the correct password. It takes about 30 seconds and requires no special software beyond Excel itself.

The steps are slightly different depending on whether you use Excel on Windows, Mac, or the web version. All three are covered below, along with what to do if you forget the password and how to remove protection later.

Key Takeaways

  • Password protection in Excel prevents anyone from opening the file without entering the correct password first.
  • The Encrypt with Password feature is found under File > Info > Protect Workbook on both Windows and Mac versions of Excel.
  • You must type the password twice to confirm it, and Excel will not show you what you typed, so write it down somewhere safe before you start.
  • If you forget the password, there is no built-in recovery method — Microsoft cannot retrieve it for you, and the file will remain locked.
  • Excel on the web does not have a native password protection feature, but you can upload a password-protected file created in desktop Excel.

Password protecting an Excel file on Windows

Open the Excel file you want to protect. Click the File tab in the top left corner of the screen. From the menu that opens, click Info on the left side.

On the right side of the Info screen, you will see a button labeled Protect Workbook. Click it, then 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 display what you type, so you will see only dots or asterisks. Click OK. A second dialog will ask you to re-enter the password to confirm it. Type it again exactly as you entered it the first time, then click OK. Save the file using Ctrl+S or File > Save. The password protection is now active.

Password protecting an Excel file on Mac

Open the Excel file you want to protect. Click File in the menu bar at the top of the screen. From the dropdown, select Info.

Look for the Protect Workbook button on the right side of the screen. Click it and choose Encrypt with Password. A dialog box will open asking for your password. Type it once, then click OK. Excel will ask you to enter the password again to confirm. Type it exactly as before and click OK. Save the file using Command+S or File > Save.

Using Excel on the web

Excel on the web (the version you access through OneDrive or SharePoint) does not have a built-in password protection feature. However, you can password protect a file using the desktop version of Excel and then upload it to the web.

If you need to password protect a file that is already stored online, read it to your computer, add the password using the steps above, and then upload the protected version back to your cloud storage. Anyone who opens the file from the web will still be prompted for the password.

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

When another person (or you, on a different device) tries to open a password-protected Excel file, they will see a dialog box when ready after clicking the file. The box says "Password" with a single text field. They must type the correct password to proceed. If they enter the wrong password, they will see an error message and can try again.

There is no limit to how many times someone can try to guess the password, so choose something that is not straightforward to guess. Avoid birthdays, names, or straightforward sequences like "123456" or "password".

Removing password protection from an Excel file

If you want to remove the 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. Leave it blank and click OK. When prompted to re-enter the password, leave that field blank too and click OK. Save the file. The password protection is now removed.

Anyone can now open the file without entering a password. If you want to add a new password instead, follow the same steps but type a new password in the first dialog instead of leaving it blank.

What to do if you forget the password

If you forget the password to an Excel file, there is no way to recover it. Microsoft does not store passwords and cannot retrieve them for you. The file will remain locked unless you remember the exact password.

This is why it is important to write down your password somewhere safe when you first create it — not in a file on the same computer, but in a physical notebook or a separate password manager. If you lose access to a file this way, your only option is to recreate the file from a backup or from scratch.

Frequently Asked Questions

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

Yes. Go to File > Info > Protect Workbook and select Protect Current Sheet instead of Encrypt with Password. This protects only the active sheet and allows others to open the file but not edit that particular sheet. You can set a different password for each sheet if you want.

Does password protecting an Excel file slow it down or change how it works?

No. A password-protected file works exactly the same as an unprotected one once it is open. The only difference is that someone must enter the password before they can access it. There is no performance impact.

Can I share a password-protected Excel file with someone else?

Yes. Send them the file through email or any file-sharing method. When they open it, they will be asked for the password. You must tell them the password separately — it is not included in the file itself. Never send the password in the same email as the file.

What if I want to protect the file but let people edit it?

Password protection with Encrypt with Password locks the entire file — no one can open it without the password. If you want people to open the file but prevent them from editing certain cells, use Protect Sheet instead, which allows you to set which cells are locked and which are editable.

Does password protection work the same way in older versions of Excel?

The steps are the same in Excel 2016 and later. In much older versions (Excel 2010 and earlier), the menu location may be slightly different — look for File > Save As and then a Tools button that offers encryption options. If you use an older version, check your version's help menu for the exact steps.