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

When you password-protect an Excel file, Windows or Mac encrypts the entire document. Anyone who tries to open it will see a prompt asking for the password before the spreadsheet appears. If they type the wrong password, the file stays closed. This is different from protecting just the cells inside a spreadsheet — password protection locks the file itself.

Excel has two separate password features. One password prevents people from opening the file at all. A second password lets people open the file but prevents them from editing it unless they know that password. You can use one, both, or neither.

The steps differ slightly between Windows and Mac, and between older versions of Excel and newer ones. Both are covered below.

Key Takeaways

  • Password protection encrypts your entire Excel file so it cannot be opened without the correct password.
  • You can set one password to prevent opening the file and a separate password to prevent editing it.
  • On Windows, use File > Info > Protect Workbook > Encrypt with Password.
  • On Mac, use File > Properties > Security and enter passwords in the two fields provided.
  • Write down your password somewhere safe — Excel cannot recover a lost password.

Password protection on Windows Excel

Open the Excel file you want to protect. Click the File tab in the top left corner. From the menu that appears, click Info. On the right side of the screen, you will see a button labeled Protect Workbook with a dropdown arrow next to it. Click that arrow.

A small menu will appear with two options: Encrypt with Password and Restrict Access. Click Encrypt with Password. A dialog box will open asking you to enter a password. Type your password in the field. Excel will not show you the letters as you type — you will see dots instead. Click OK.

Excel will ask you to type the password a second time to confirm it. Type it again exactly as you did the first time, then click OK. The file is now password-protected. The next time anyone opens this file, they will be asked for the password before they can see the spreadsheet.

Password protection on Mac Excel

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 Properties. A window will open with several tabs across the top. Click the Security tab.

You will see two password fields. The first field is labeled Password to open — this is the password that prevents anyone from opening the file without it. The second field is labeled Password to modify — this password lets people open the file but prevents them from editing it unless they know this password. You can fill in one, both, or neither.

Type your password in whichever field or fields you want to use. As on Windows, Excel shows dots instead of the letters you type. Click OK when you are done. Mac will ask you to confirm the password by typing it again. Type it exactly as before and click OK. The file is now protected.

The difference between "password to open" and "password to modify"

Password to open is the stronger protection. If you set only this password, nobody can see the file at all without typing it correctly. The file stays completely closed until someone enters the right password.

Password to modify is weaker. It lets people open the file and read it, but they cannot make changes or save the file under the same name unless they know the password. Someone could open the file, read all your data, and save a copy with a different filename — they just cannot edit the original. Use this when you want people to see the spreadsheet but not change it.

If you set both passwords, someone must know the "password to open" just to see the file. If they somehow get past that, they would need the "password to modify" to edit it. In practice, most people use only the "password to open" password.

What to do if you forget your password

Excel cannot recover a lost password. Microsoft does not have a master key, and there is no official way to unlock a file if you forget the password. If you set a password and then forget it, the file is locked permanently.

Before you password-protect a file, write the password down and store it somewhere safe — a notebook in a drawer, a password manager, or a sealed envelope. Do not email it to yourself or store it in a place where someone else might find it. If you are protecting the file because you want to keep it private, the password itself needs to stay private too.

Removing a password from a file you already protected

Open the password-protected file. Excel will ask you for the password — type it in. Once the file is open, follow the same steps you used to add the password in the first place. On Windows, go to File > Info > Protect Workbook > Encrypt with Password. On Mac, go to File > Properties > Security.

This time, when the password dialog appears, leave the password field blank. Do not type anything. Click OK. Excel will ask you to confirm by leaving the field blank again. Click OK a second time. The password is now removed, and the file will open without asking for one.

Why password protection is not the same as file encryption

When you password-protect an Excel file, Excel encrypts it. That means the data inside is scrambled in a way that only someone with the password can unscramble. This is different from just putting a password on your Windows or Mac user account, which only prevents someone from logging into your computer.

If you email a password-protected Excel file to someone, they cannot open it without the password, even if they somehow get access to your email account. If you store it on a shared cloud drive like OneDrive or Google Drive, the file stays locked unless someone knows the password. Password protection travels with the file itself.

Frequently Asked Questions

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

Yes, but it works differently. To protect individual sheets, go to File > Protect Sheet (Windows) or Review > Protect Sheet (Mac). This prevents people from editing that sheet without a password, but they can still open the file and see the other sheets. This is weaker than protecting the entire file, because someone can still access your workbook — they just cannot change one particular sheet.

What happens if someone tries to open my password-protected file?

They will see a dialog box asking for the password. If they type the wrong password, Excel will tell them it is incorrect and ask them to try again. They can keep guessing, but Excel does not lock them out after a certain number of wrong attempts. If they guess correctly, the file opens normally.

Does password protection work if I save the file as a PDF instead of Excel format?

No. Password protection is an Excel feature. If you save an Excel file as a PDF, the password protection is lost. PDFs have their own password protection system, which you set through your PDF reader or a separate PDF tool, not through Excel.

Will my password-protected file still work if I share it with someone using an older version of Excel?

Usually yes, but it depends on how old their version is. Files protected in Excel 2007 and later use encryption that older versions may not recognize. If you are sharing with someone using Excel 2003 or earlier, test the file with them first to make sure they can open it with the password.

Can I use the same password for both "password to open" and "password to modify"?

Yes, you can type the same password in both fields. However, it does not give you extra security — it just means one password controls both opening and editing. Most people either use one password for opening only, or use two different passwords if they want different levels of access for different people.