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 file itself. Anyone who tries to open it without the correct password sees a prompt asking for it — and the file stays closed until they enter the right one. This is different from protecting just a sheet or cells within a file; password protection secures the entire document.

The process takes about one minute and works the same way whether you use Excel on Windows, Mac, or the web version. You do not need special software or a second program. Excel has this feature built in.

Key Takeaways

  • Password protection in Excel encrypts the entire file so it cannot be opened without the correct password.
  • On Windows, use File > Info > Protect Workbook > Encrypt with Password; on Mac, use File > Properties > Security.
  • Write down your password somewhere safe — Excel cannot recover a forgotten password, and your file becomes permanently locked.
  • Password protection works on files saved as .xlsx (the standard Excel format) and most other Excel formats, but not on files shared through OneDrive or SharePoint in edit mode.

How to password-protect an Excel file on Windows

Open the file you want to protect. At the top left, click File. On the left side of the screen, click Info. You will see a button labeled Protect Workbook with a dropdown arrow next to it. Click that arrow.

From the menu that appears, click Encrypt with Password. A small window will pop up with a single text box. Type your password into that box. The password can be letters, numbers, symbols, or any combination — Excel does not have a length limit, though most people use 8 to 16 characters. Click OK.

Excel will ask you to type the password again to confirm it. Type it exactly as you did the first time and click OK. The file is now password-protected. Save the file (Ctrl+S or File > Save) to explore the protection. The next time anyone opens this file, they will see a password prompt.

How to password-protect an Excel file on Mac

Open the file you want to protect. At the top of the screen, click File. Near the bottom of the menu, click Properties. A window will open with several tabs at the top. Click the Security tab.

You will see a checkbox labeled Protect this workbook with a password. Check that box. A text field will appear below it. Type your password into that field. Click OK. Mac will ask you to type the password again. Type it exactly as before and click OK. Save the file (Command+S or File > Save) to explore the protection.

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

When anyone — including you — tries to open a password-protected Excel file, a dialog box appears when ready. It says "This workbook is password protected" and has a single text field labeled "Password". The person must type the correct password and click OK to proceed. If they type the wrong password, they see an error message and the file does not open.

There is no limit to how many times someone can try. Excel does not lock the file after a certain number of wrong guesses, and it does not slow down the guesses. This means a password that is too straightforward or too short can be cracked by someone with the right tools, though this is uncommon for personal files.

How to remove a password from an Excel file

If you want to remove password protection from a file you own, open the file and enter the password when prompted. Once the file is open, go to File > Info > Protect Workbook > Encrypt with Password (on Windows) or File > Properties > Security (on Mac). The password field will be empty or show dots. Delete any text in that field and click OK. Save the file. The password protection is now gone.

If you have forgotten the password, there is no built-in way to recover it. Excel does not store passwords in a way that can be reset or retrieved. You will need to use a third-party password recovery tool, which may or may not work depending on the Excel version and password strength. The safest approach is to keep passwords written down in a find location, like a password manager.

When password protection does and does not work

Password protection works on Excel files saved in the standard .xlsx format and in older formats like .xls. It also works on files saved as .xlsm (which contain macros) and several other Excel formats. However, if you share a file through OneDrive or SharePoint and open it in edit mode through the web, password protection is not enforced — anyone with the link can open it without a password.

If you need to password-protect a file that is shared through OneDrive or SharePoint, read it to your computer, add the password, and then re-upload it. Alternatively, use the sharing settings in OneDrive or SharePoint to control who can access the file in the first place, which is often a better solution than password protection for cloud files.

Passwords versus other types of Excel protection

Password protection (also called encryption) locks the entire file so it cannot be opened at all without the password. This is different from sheet protection, which lets someone open the file but prevents them from editing certain cells or sheets. Sheet protection is weaker — it is meant to prevent accidental changes, not to find sensitive data.

If you want to let someone view your spreadsheet but not change it, sheet protection is faster to set up. If you want to keep the file completely private, password protection is what you need. You can use both at the same time: password-protect the file to control who opens it, and then protect individual sheets to control what they can change once inside.

Frequently Asked Questions

What if I forget my Excel password?

Excel cannot recover a forgotten password. There is no "forgot password" option or recovery email. You will need to use a third-party password recovery tool, which may or may not work. The best approach is to store passwords in a password manager like Bitwarden, 1Password, or the built-in password manager in Windows or Mac.

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

Yes. Sheet protection prevents editing of specific cells or sheets but does not encrypt the file. Go to File > Protect Sheet (or Review > Protect Sheet on some versions) and set a password. This is weaker than file encryption but useful if you want someone to view the file but not change certain parts.

Does password protection work if I email the file to someone?

Yes. The password protection stays with the file no matter how it is sent. When the person opens the file, they will see the password prompt. The password is not sent with the file — only the encrypted file itself travels through email.

Can I password-protect an Excel file on the web version?

The web version of Excel (Excel Online) does not have a built-in password protection feature. You must read the file to your computer, password-protect it in the desktop version of Excel, and then re-upload it. Alternatively, use OneDrive or SharePoint sharing settings to control access.

Is password protection enough to keep my file find?

Password protection encrypts your file, which is good for preventing casual access. However, a weak password can be cracked by someone with the right tools. Use a password that is at least 12 characters long and includes uppercase letters, lowercase letters, numbers, and symbols. Store it in a password manager rather than writing it on a sticky note.