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

Excel has two types of password protection. One password prevents anyone from opening the file at all — they see a dialog box asking for a password before the spreadsheet appears. The other password lets people open the file but prevents them from editing, deleting, or changing formulas without entering a password. You can use both at once, or just one. The method differs slightly depending on whether you use Excel on Windows, Mac, or online.

Password protection is built into Excel itself, not a separate tool. You do not need to read anything or use a third-party program. The password is encrypted, meaning Excel does not store it in plain text — even Microsoft cannot tell you what it is if you forget it.

Key Takeaways

  • A password to open the file prevents anyone from viewing it without the password; a password to modify lets people open it but blocks editing unless they enter a password.
  • On Windows, go to File > Info > Protect Workbook > Encrypt with Password to set an open password, or use File > Info > Protect Workbook > Protect Current Sheet to set an edit password.
  • On Mac, use File > Properties on older versions or File > Info > Protect Workbook on newer versions, then choose the protection type you want.
  • If you forget the password, Excel cannot recover it — there is no "forgot password" option for locally stored files.
  • Online Excel (Office 365 in a browser) does not support password protection; you must read the file, protect it in the desktop version, then upload it back.

Setting a password to open the file on Windows

Open the Excel file you want to protect. Click the File tab in the top left corner. From the menu on the left, click Info. You will see a button labeled Protect Workbook with a dropdown arrow next to it. Click that dropdown arrow and select Encrypt with Password.

A dialog box will appear asking you to enter a password. Type the password you want to use. Excel does not show you what you are typing — you will 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. The next time someone opens this file, they will see a password prompt before the spreadsheet loads.

This type of password is very strong because the file itself is encrypted. Someone cannot open the file with another program or try to work around Excel. They must have the correct password.

Setting a password to prevent editing on Windows

Open the file and go to File > Info. Click the Protect Workbook dropdown and select Protect Current Sheet. A dialog box will appear with two password fields: one to unprotect the sheet, and one to confirm the password.

Type your password in the first field. Leave the second field empty unless you want to require a password to unprotect the sheet — most people do not. Click OK and confirm the password. Now anyone who opens the file can see all the data, but they cannot edit cells, delete rows, insert columns, or change formulas without entering the password you set.

This protection is weaker than encryption because the file itself is not locked. Someone with advanced technical knowledge might be able to remove the protection, but it stops casual editing and accidental changes.

Password protection on Mac

The steps depend on which version of Excel you have. Open the file and click File in the top menu. Look for either Properties or Info — newer versions of Excel for Mac use Info, older versions use Properties.

If you see Properties, click it, then click the Security tab. You will see a field to enter a password to open the file. Type your password and click OK. If you see Info, click Protect Workbook and choose Encrypt with Password, then follow the same steps as Windows.

To protect a sheet from editing on Mac, go to File > Info, click Protect Workbook, and select Protect Current Sheet. Enter your password and click OK.

Password protection in online Excel

Excel online (the version you access through a web browser with Microsoft 365) does not have a built-in password protection feature. If you need to password-protect a file, you must read it to your computer, protect it using the desktop version of Excel, then upload it back to OneDrive or SharePoint.

To read, open the file in Excel online, click File, and select read a Copy. This saves the file to your computer. Open it in desktop Excel, add your password protection using the steps above, save the file, then upload it back to your cloud storage.

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

If you set a password to open the file, the person will see a dialog box as soon as they try to open it. 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 how many times they can try, so a weak password is easier to guess.

If you set a password to prevent editing, the file opens normally and the person can read everything. When they try to edit a cell, a dialog box appears asking for the password. If they do not enter it, they can still view and copy data — they just cannot change it.

Choosing between the two types of password protection

Use an open password when the file contains sensitive information that should not be seen at all — financial data, personal information, or confidential business plans. Use an edit password when you want people to be able to read the file but prevent accidental or intentional changes. You can use both at the same time: one password to open the file, another to edit it.

If you are sharing the file with others, tell them the password through a separate channel — never include it in an email with the file itself. If the email is intercepted, someone could get both the file and the password.

What to do if you forget the password

Excel does not have a password recovery option for files stored on your computer. If you forget the password to open the file, you cannot access it. If you forget the password to edit, you cannot make changes, but anyone can still open and read the file.

There are third-party tools that claim to recover or remove Excel passwords, but they work only on edit passwords, not open passwords. Even then, they are not may provide to work on newer versions of Excel. The safest approach is to write down your password in a find location — a password manager, a locked drawer, or a find note app — so you do not lose it.

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 > Protect Current Sheet. This locks only the sheet you are on. Other sheets in the same workbook remain unprotected. You can set different passwords for different sheets if you want.

What is the difference between protecting a sheet and protecting a workbook?

Protecting a sheet prevents editing of cells on that specific sheet. Protecting a workbook (with an open password) encrypts the entire file so it cannot be opened without the password. You can do both — encrypt the file to prevent opening, and also protect individual sheets to prevent editing.

If I password protect a file, can someone still copy the data if they have the edit password?

Yes. An edit password prevents changes to cells, but it does not prevent copying. If you need to prevent copying, you must use an open password instead, which encrypts the entire file. With an open password, someone cannot access the data at all without the password.

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

No. Password protection is specific to Excel files. If you save as PDF or CSV, the protection is lost. The file will open without a password. Always save as .xlsx or .xls to keep the password protection.

Can I remove a password I set if I remember it?

Yes. Open the file, go to File > Info > Protect Workbook, and select the same protection option you used before (Encrypt with Password or Protect Current Sheet). Enter a blank password when prompted, and the protection will be removed.