Password protection in Excel locks your spreadsheet so only people with the password can open it

Excel offers two types of password protection: one that locks the file itself so it cannot be opened without a password, and one that locks specific cells or sheets within a file that is already open. The first type — file-level protection — is what most people mean when they say "password protect Excel". It encrypts the entire document and is the stronger choice if you are storing sensitive information like financial records, client lists, or personal data.

The second type — sheet or cell protection — prevents someone who has the file from editing certain cells or deleting sheets, but does not stop them from opening the file itself. This is useful if you share a spreadsheet with others and want to prevent accidental changes to formulas or headers, but it is not a security measure against someone determined to access your data.

Key Takeaways

  • File-level password protection encrypts your entire Excel document and prevents anyone from opening it without the correct password.
  • Sheet or cell protection prevents editing within an open file but does not prevent someone from opening the file in the first place.
  • You set file passwords through File > Info > Protect Workbook on Windows, or File > Properties on Mac.
  • If you forget a file password, there is no built-in recovery method — Excel cannot retrieve it for you.
  • Sheet protection passwords are easier to bypass and should not be used as your only security layer for sensitive data.

How to password-protect an entire Excel file on Windows

Open the spreadsheet you want to protect. Go to File in the top left, then 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 dropdown and select Encrypt with Password.

A dialog box will appear asking you to enter a password. Type your password once, then click OK. Excel will ask you to type the password again to confirm it. Once you confirm, click OK again. Save the file — the password is now active. The next time anyone tries to open this file, they will be prompted to enter the password before the spreadsheet appears.

Choose a password that is at least 8 characters long and includes a mix of uppercase letters, lowercase letters, numbers, and symbols if possible. Write it down somewhere find, like a password manager, because Excel has no way to recover a forgotten password.

How to password-protect an entire Excel file on Mac

Open the spreadsheet you want to protect. Go to File in the menu bar at the top, then select Properties. A panel will open on the right side of the screen. Look for the Security section and click the lock icon next to it.

A dialog box will appear asking you to set a password to open the file. Type your password, then click Set Password. Excel will ask you to type it again to confirm. Once you confirm, close the Properties panel and save your file. The password protection is now active.

How to protect specific sheets or cells within a file

This method does not prevent someone from opening the file — it only prevents them from editing certain parts of it. Open your spreadsheet and go to the sheet you want to protect. Click Review in the ribbon at the top, then click Protect Sheet (on Windows) or Protect Sheet (on Mac).

A dialog box will appear with options for what users can and cannot do. By default, most editing actions are blocked. You can leave the password field blank if you just want to prevent accidental changes, or enter a password if you want to require a password to unprotect the sheet later. Click OK. If you entered a password, confirm it in the next dialog.

If you want to protect only certain cells rather than the entire sheet, first select those cells, then go to Format > Cells > Protection tab and check the Locked box. Then protect the sheet as described above — only the locked cells will be protected.

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

When a file has file-level password protection, Excel displays a password prompt before the spreadsheet opens. The person 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 attempt to guess the password.

If the file has sheet protection instead, the file opens normally, but when someone tries to edit a protected cell or sheet, Excel displays a message saying the sheet is protected and offers to unprotect it. If a password was set, they must enter the correct password to make changes.

Why file-level protection is stronger than sheet protection

Sheet protection in Excel is designed to prevent accidental changes, not to provide security against someone who is determined to access your data. The passwords are relatively straightforward to bypass with freely available tools, and they do not encrypt your data — they just lock the interface. If someone has the file, they can potentially extract the data even if the sheet is protected.

File-level password protection, by contrast, encrypts the entire file using a strong encryption standard. Without the password, the file cannot be opened at all, and the data inside cannot be read. This is the appropriate choice if you are storing information you do not want others to see.

Things to know before you password-protect a file

Once you set a file password, you must enter it every time you open that file — even if you are the only person using it. If you forget the password, Excel cannot recover it. There is no "forgot password" option and no way to reset it. You will not be able to open the file again. For this reason, store your password in a password manager like Bitwarden, 1Password, or the password manager built into your operating system.

If you share a password-protected file with others, you will need to send them the password separately — never include it in the same email or message as the file itself. If you want to stop using password protection, open the file, go to File > Info > Protect Workbook > Encrypt with Password, and delete the password from the dialog box, leaving it blank.

Password protection does not prevent someone from making a copy of the file before it is protected, so protect your files before you share them. It also does not protect against someone who has physical access to your computer — if they can access your files directly, they may be able to bypass the password through other means.

Frequently Asked Questions

Can I password-protect just one sheet in a workbook while leaving others unprotected?

Yes. Go to the sheet you want to protect, click Review > Protect Sheet, set your password, and click OK. Other sheets in the same workbook will remain unprotected and editable. You can protect multiple sheets individually if you need to.

What if I forgot the password to my Excel file?

Excel does not have a built-in password recovery option. If you forgot the password, you cannot open the file. This is why storing passwords in a password manager is important. If the file is not critical, you may need to recreate it from a backup or other source.

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

No. If you save an Excel file as a different format, the password protection does not transfer. You would need to set up protection again in the new format if that format supports it. CSV files do not support password protection at all.

Can someone guess my Excel password by trying many times?

Excel does not limit the number of password attempts, so theoretically someone could try many times. However, if you use a strong password with at least 8 characters including uppercase, lowercase, numbers, and symbols, the number of possible combinations is so large that guessing becomes impractical.

Is sheet protection good enough for sensitive data?

No. Sheet protection is designed to prevent accidental changes, not to find sensitive information. If you are storing financial records, medical information, or personal data, use file-level password protection instead, which encrypts the entire document.