Excel has a built-in password feature that locks your file until someone enters the correct password

When you password-protect an Excel file, you are adding a layer that requires anyone opening it to type in a password first. Excel offers two types of protection: one that locks the file itself so it cannot be opened without the password, and one that locks specific cells or sheets within an already-open file. Most people want the first kind — the file-level protection that stops someone from opening the document at all.

The process takes about one minute and works the same way on Windows and Mac. Your password is encrypted, meaning Excel does not store it in plain text. However, if you forget the password, there is no recovery option — you cannot open the file again. This is by design: it means no one else can recover it either.

Key Takeaways

  • File-level password protection prevents anyone from opening the Excel file without typing the correct password first.
  • You set a password through the Save As dialog by choosing a file format that supports encryption, such as .xlsx or .xlsm.
  • If you forget your password, there is no built-in way to recover it or open the file — write it down or store it in a password manager.
  • Password-protecting a file is different from protecting specific cells or sheets, which allows the file to open but locks certain content from editing.
  • Excel's encryption is strong enough for personal and small-business use, though it is not military-grade security.

How to password-protect an Excel file on Windows

Open the file you want to protect. Click File in the top-left corner, then click Save As. Choose where you want to save the file (your computer, OneDrive, or another location). Type the filename you want to use.

Before clicking Save, look for a button labeled Tools near the bottom-right of the Save As dialog. Click the small arrow next to it and select General Options. A dialog box will appear with two password fields: one labeled Password to open and one labeled Password to modify. Type your password in the Password to open field. This is the one that locks the entire file. Leave the Password to modify field empty unless you want a second password that allows people to open the file but not edit it. Click OK, then type your password again to confirm it. Click Save.

The file is now password-protected. The next time anyone tries to open it, Excel will ask for the password before showing any content.

How to password-protect an Excel file on Mac

Open the file you want to protect. Click File in the menu bar at the top, then click Save As. Type the filename and choose where to save it. Make sure the file format is set to Excel Workbook (.xlsx) — this is important because some older formats do not support password protection.

Look for a checkbox labeled Encrypt with password near the bottom of the Save As dialog. Check that box. A password dialog will appear. Type your password and click OK, then type it again to confirm. Click Save.

On Mac, there is no separate "password to modify" option in the standard Save As dialog. If you need that level of control, you can use the Tools menu after saving, but the basic file-level password works the same way as Windows.

The difference between file-level and cell-level protection

File-level password protection locks the entire file. No one can open it or see any content without the password. This is what most people mean when they say "password-protect my Excel file."

Cell-level or sheet-level protection is different. It allows the file to open normally, but it locks certain cells or entire sheets so they cannot be edited. Someone can still see the data — they just cannot change it. You set this up through File > Info > Protect Workbook (on Windows) or Tools > Protect Sheet (on Mac). This is useful if you want to share a spreadsheet with colleagues but prevent them from accidentally changing formulas or headers.

If you want to prevent people from even seeing the file, use file-level protection. If you want to let people see and use the file but prevent editing, use cell or sheet protection.

What happens if you forget your password

Excel does not have a "forgot password" recovery option. If you forget the password to a file-level protected workbook, you cannot open it. There is no master password, no recovery email, and no way to contact Excel support to unlock it. This is intentional — it means the protection is equally strong against you and against anyone else.

The only way to avoid this is to write down your password or store it in a password manager like Bitwarden, 1Password, or KeePass. If you use a password manager, you can generate a strong password and let the manager remember it for you. If you write it down, keep the paper in a safe place separate from your computer.

If you have already forgotten a password and need to open the file, there are third-party tools that claim to crack Excel passwords, but they are slow, unreliable, and often cost money. For most people, the practical answer is to accept that the file is locked and move on.

How strong is Excel password protection

Excel uses encryption that is strong enough for personal documents and small-business files. If someone has the file but not the password, they cannot open it through normal means. However, Excel's encryption is not military-grade, and determined attackers with specialized software and time can sometimes break older Excel formats (.xls files from before 2007).

For modern Excel files (.xlsx and .xlsm), the encryption is much stronger. If you are protecting a file with sensitive information — financial records, medical data, personal details — password protection is a reasonable first step. If you are protecting state secrets or classified information, you would need additional security measures beyond what Excel offers.

The real-world risk for most people is not a hacker breaking the encryption. It is someone you know gaining access to your computer and opening the file, or you forgetting the password yourself. Password protection stops both of those scenarios.

Protecting files you share through email or cloud storage

If you are sending a password-protected Excel file to someone via email, tell them the password through a separate channel — a phone call, a text message, or a different email. Do not put the password in the same email as the file. This way, even if someone intercepts the email, they have only the file or the password, not both.

If you are storing the file in cloud storage like OneDrive, Google Drive, or Dropbox, password protection still works. The file is encrypted on your device before it is uploaded, so the cloud service cannot read it. However, anyone who has access to your cloud account can read the file — they just cannot open it without the password. Make sure your cloud account itself has a strong password.

If you are sharing the file with colleagues through a shared folder or link, password protection prevents them from opening it unless you give them the password. This is useful if you want to control who sees the content, but remember that once they have the password, they can open it whenever they want.

Frequently Asked Questions

Can I password-protect an Excel file that is already open in OneDrive or Google Drive?

You can password-protect an Excel file stored in OneDrive by downloading it to your computer, protecting it through Save As, and uploading it back. Google Drive does not natively support Excel password protection — you would need to read the file, protect it in Excel, and re-upload it. Once protected, the file stays protected regardless of where it is stored.

What if I want to let someone edit the file but not see certain columns?

File-level password protection is all-or-nothing — they either see everything or nothing. If you want them to see some columns but not others, you would need to create a separate file with only the columns they should see, or use sheet-level protection to hide specific sheets. There is no built-in way to hide individual columns from someone who has the password.

Does password-protecting an Excel file slow it down?

No. The file opens and saves at the same speed as an unprotected file. The only difference is that Excel asks for the password before opening it. Once you type the password, the file behaves normally.

Can I change the password on an already-protected file?

Yes. Open the file with the current password, go to File > Save As, and follow the same steps as before. When you reach the password dialog, type a new password instead of the old one. The file will be re-saved with the new password.

Is password protection enough to keep my file safe?

Password protection stops someone from opening the file without the password, but it does not protect against other risks. If your computer is infected with malware, someone could steal the password as you type it. If you use a weak password, someone could guess it. If you leave your computer unlocked, someone could open the file while you are logged in. Password protection is one layer of security, not a complete solution.