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

When you password-protect an Excel file, Windows or Mac encrypts the file and requires anyone who opens it to type the correct password first. This stops someone from opening the file by accident or on purpose if they get hold of your computer or the file itself. The password you set is the only way in — there is no back door, and if you forget it, Microsoft cannot recover the file for you.

The steps differ slightly between Windows and Mac, and between newer versions of Excel (2016 and later) and older ones. This guide covers the current versions on both systems. The process takes about two minutes.

Key Takeaways

  • You set a password through the File menu under "Info" on Windows, or "Protect Workbook" on Mac — not through a separate security dialog.
  • The password encrypts the entire file, so anyone trying to open it must enter the password before they see any data.
  • If you forget the password, the file is locked permanently and cannot be recovered by Microsoft or anyone else.
  • Password protection works the same way whether you save the file as .xlsx, .xls, or any other Excel format.
  • You can change or remove the password later by opening the file and going through the same menu again.

How to password-protect an Excel file on Windows

Open the Excel file you want to protect. Click the File tab at the top left of the screen. From the menu on the left, click Info. You will see a button labeled Protect Workbook on the right side of the screen.

Click Protect Workbook, then select Encrypt with Password from the dropdown menu. A dialog box will appear asking you to enter a password. Type the password you want to use — it can be any combination of letters, numbers, and symbols. Excel does not show the characters as you type, so you will see dots instead. Click OK.

Excel will ask you to type the password again to confirm it. Type the same password and click OK. Save the file by pressing Ctrl+S or clicking File and then Save. The file is now password-protected. The next time anyone tries to open it, they will see a password prompt before the file opens.

How to password-protect an Excel file on Mac

Open the Excel file you want to protect. Click the File menu at the top of the screen. Look for an option called Protect Workbook or Properties — the exact wording depends on your Excel version. Click it.

A dialog box will open. Look for a field labeled Password or Encrypt with Password. Type the password you want to use in this field. Click OK or Save, depending on what your version shows. Mac will ask you to type the password a second time to confirm it. Type it again and click OK.

Save the file by pressing Command+S or clicking File and then Save. The file is now password-protected. Anyone opening it will need to enter the password first.

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

When a password-protected Excel file is opened, a dialog box appears immediately asking for the password. The person opening the file must type the correct password and click OK to proceed. If they type the wrong password, Excel shows an error message and returns to the password prompt. They can try again, but there is no limit to how many times they can attempt to enter the password.

This means a password protects against casual access but not against someone determined to guess or crack it. Use a strong password — one that mixes uppercase letters, lowercase letters, numbers, and symbols — to make guessing much harder. Avoid passwords based on birthdays, names, or other information someone might know about you.

How to change or remove a password

If you want to change your password or remove it entirely, open the file and enter the current password when prompted. Once the file is open, follow the same steps you used to set the password in the first place: go to File, then Info (Windows) or Properties (Mac), then Protect Workbook or Encrypt with Password.

To change the password, type the new password in the field and click OK. To remove the password entirely, leave the password field blank and click OK. Save the file. On your next attempt to open it, no password will be required.

Why password protection is not the same as sharing settings

Password protection and sharing permissions are two different things. Password protection encrypts the file itself so it cannot be opened without the password. Sharing permissions, which you set through OneDrive or SharePoint, control who can view or edit a file that is already open and shared with others.

If you share a password-protected file with someone through OneDrive, they will still need to enter the password to open it, even though you have given them permission to access it. The password is a separate layer of security that applies to the file itself, not to your sharing settings.

What to do if you forget your password

If you forget the password to an Excel file, the file cannot be opened. Microsoft does not have a way to reset or recover passwords on encrypted files, and no third-party tool can reliably unlock an Excel file that was password-protected with a recent version of Excel.

The only way to avoid this is to store your password somewhere safe — a password manager, a locked drawer, or another secure location where you can find it later. Write it down or save it in a way that makes sense to you. If you lose access to the file, you will need to recreate the data from a backup or another source.

Frequently Asked Questions

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

Yes. Excel lets you protect individual sheets separately from the whole workbook. To protect a single sheet, right-click the sheet tab at the bottom, select Protect Sheet, and enter a password. This prevents someone from editing or deleting that sheet, but they can still open the file and see other unprotected sheets. Full file encryption (the method in this guide) requires a password to open the file at all.

Does password protection work if I save the file as a PDF?

No. If you save an Excel file as a PDF, the password protection does not transfer. You would need to set a separate password on the PDF using your PDF reader or a PDF tool. The Excel password only works on Excel files.

Can I open a password-protected Excel file on my phone or tablet?

Yes, if you have the Excel app installed. When you try to open the file, the app will prompt you for the password. The same password you set on your computer will work on your phone or tablet.

What if I share a password-protected file and the other person forgets the password?

They will not be able to open the file. You will need to open it yourself, remove the password, and send them the unprotected version. There is no way for them to recover or reset the password on their own.

Does password protection slow down my Excel file?

No. Password protection does not affect how fast the file opens or how it performs once it is open. The only difference is the password prompt that appears before the file opens.