Password protection in Excel works differently depending on whether you want to lock the whole file or just the sheets inside it

Excel gives you two separate password options. You can password-protect the file itself so nobody can open it without the password, or you can protect individual sheets within a file so people can open the file but cannot edit specific sheets. Most people want file-level protection — the kind that stops someone from opening the document at all. Sheet protection is useful if you want to share a file but lock down certain tabs or cells.

The steps differ slightly between Excel on Windows, Excel on Mac, and Excel online. Windows and Mac use nearly identical menus. Excel online (the free version you access through a web browser) does not offer password protection — you must use the desktop version or the paid online version.

This guide covers file-level password protection, which is what most people need. If you want to protect only specific sheets within a file that others can still open, that is a separate feature covered in the FAQ section below.

Key Takeaways

  • File-level password protection prevents anyone from opening your Excel file without entering the correct password first.
  • On Windows and Mac, you password-protect a file by going to File > Info > Protect Workbook > Encrypt with Password.
  • Excel does not show your password as you type it, so write it down somewhere safe before you click OK, or you will lock yourself out.
  • Sheet protection (locking individual tabs) is a different feature that lets people open the file but prevents them from editing certain sheets.
  • Excel online does not support password protection — you need the desktop version or a paid Microsoft 365 subscription to use this feature.

How to password-protect a file on Windows

Open the Excel file you want to protect. Click the File tab in the top left corner. From the menu that appears, click Info — it is usually the first option on the left side.

On the right side of the screen, you will see a button labeled Protect Workbook with a dropdown arrow next to it. Click that dropdown arrow. A small menu will appear with the option Encrypt with Password. Click it.

A dialog box will open asking you to enter a password. Type your password into the field. Excel will not show you what you are typing — the field will display dots or asterisks instead. This is a security feature, but it also means you cannot see if you made a typo. Write your password down on paper or in a password manager before you click OK. If you forget the password, Excel cannot recover it, and you will not be able to open the file.

Click OK. Excel will ask you to enter the password again to confirm it. Type the same password a second time and click OK. The file is now password-protected. The next time anyone tries to open it, Excel will ask for the password before the file opens.

How to password-protect a 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 menu, click Info.

You will see a section labeled Protect Workbook with a button that says Encrypt with Password. Click that button. A dialog box will appear asking for your password.

Type your password into the field. As on Windows, Excel will not display what you type — you will see dots or asterisks instead. Write down your password before proceeding. Click OK. Excel will ask you to confirm the password by typing it again. Enter it a second time and click OK. Your file is now password-protected.

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

When another person (or you, on another device) tries to open a password-protected Excel file, a dialog box appears before the file opens. It says "Password" and has a single text field. The person must type the correct password and click OK to proceed. If they enter the wrong password, Excel will say "Incorrect password" and ask them to try again.

There is no limit to how many times someone can try different passwords, so a weak password (like "123456" or "password") can be cracked relatively quickly by someone with basic tools. Use a password that combines uppercase letters, lowercase letters, numbers, and symbols — something like "BlueSky$42Oak" rather than "bluesky42". The longer the password, the harder it is to crack.

How to remove a password from a file you already protected

Open the password-protected file. Excel will ask for the password — enter it. Once the file is open, go to File > Info > Protect Workbook > Encrypt with Password. The same dialog box will appear, but this time the password field will be empty. Leave it blank and click OK. Click OK again when asked to confirm. The password protection is now removed.

If you forget the password to a file you created, there is no built-in recovery method. You cannot open the file without the correct password, and Excel does not have a "forgot password" option. This is why writing down your password or storing it in a password manager is essential.

Sheet protection versus file protection

Sheet protection is different from file protection. When you protect a sheet, people can still open the file, but they cannot edit the cells, formulas, or structure of that specific sheet. You might use this if you want to share a spreadsheet with colleagues but prevent them from accidentally (or intentionally) changing your formulas or deleting rows.

To protect a sheet instead of the whole file, go to File > Info > Protect Workbook and look for Protect Current Sheet instead of Encrypt with Password. You can set a password for sheet protection too, but it is optional — you can protect a sheet without a password, and people will straightforward see a message saying "This sheet is protected" if they try to edit it.

Sheet protection does not prevent someone from copying the data or seeing the formulas — it only prevents editing. If you need true security, use file-level password protection instead.

Why Excel online does not support password protection

Excel online (the free version you access through OneDrive or Outlook.com) does not have a password protection feature. If you need to password-protect a file, you must use the desktop version of Excel on Windows or Mac, or you must have a Microsoft 365 subscription, which includes the online version with additional security features.

If you create or edit a file in Excel online and then read it to your computer, you can password-protect it using the desktop version. The password will remain in place when you upload it back to OneDrive.

Frequently Asked Questions

Can I password-protect just one sheet in a file while leaving other sheets unprotected?

Yes. Click on the sheet tab you want to protect, then go to File > Info > Protect Workbook > Protect Current Sheet. Only that sheet will be protected. Other sheets in the same file will remain editable. You can repeat this for multiple sheets if needed.

What if I forgot my password and cannot open the file?

Excel does not have a password recovery tool. If you forget the password, the file is locked and cannot be opened without it. This is why storing your password in a password manager or writing it down is important. If the file is critical, you may need to contact the person who created it to ask for the password.

Does password protection encrypt the data inside the file?

File-level password protection in Excel does encrypt the file, which means the data is scrambled and unreadable without the password. However, the strength of the encryption depends on your Excel version and the password strength you choose. A weak password can be cracked with specialized tools, so use a strong, complex password.

Can I password-protect a file and then share it with others?

Yes. You can share a password-protected file by email or cloud storage. You will need to give the password to the people you want to access it, but you can send the password separately from the file for added security — for example, the file by email and the password by text message.

If I password-protect a file, can I still edit it myself?

Yes. You can edit a password-protected file as much as you want. You only need to enter the password when you first open the file. Once it is open, you can make changes and save them normally. The password protection stays in place even after you save your edits.