Password protection locks your Excel file so it cannot be opened without the correct password

Excel has a built-in feature that encrypts your file and requires a password before anyone can view, edit, or even see the contents. This works on both Windows and Mac versions of Excel, and the password stays with the file — if you email it or move it to another computer, the protection travels with it.

The steps differ slightly between Windows and Mac, and between newer versions of Excel (2016 and later) and older ones. This guide covers the most common setup: Excel 2016 or newer on Windows, with a note on Mac differences at the end.

Key Takeaways

  • Excel's password protection encrypts your file so it cannot be opened without entering the correct password first.
  • On Windows, go to File > Info > Protect Workbook > Encrypt with Password, then type your password twice.
  • On Mac, use File > Properties > Security and enter your password in the "Password to open" field.
  • Write your password down somewhere safe outside the file — if you forget it, you cannot recover the file or its contents.
  • Password protection does not prevent someone from making a copy of the file; it only prevents them from opening the copy without the password.

Password protecting an Excel file on Windows

Open the Excel file you want to protect. Make sure you have saved all your work first — you will save the file again after adding the password, and you want the latest version locked.

Click the File tab at the top left of the screen. This opens a menu on the left side. Click Info (usually the first option). 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 arrow.

A small menu appears with several options. Click Encrypt with Password. A dialog box opens asking you to enter a password. Type your password in the field — it will appear as dots or asterisks so nobody looking over your shoulder can see it. Click OK.

Excel asks you to enter the password again to confirm you typed it correctly. Type the same password a second time and click OK. The file is now saved with password protection. The next time anyone opens this file, they will see a password prompt before the spreadsheet appears.

Password protecting an Excel file on Mac

Open the file you want to protect and save your work. Click File in the menu bar at the top of the screen. A dropdown menu appears. Click Properties (or Info in some versions).

A dialog box opens. Look for a Security section or tab. In the field labeled Password to open, type your password. Some versions also have a Password to modify field, which lets people view the file without a password but requires a password to make changes — leave this blank unless you specifically want that setup.

Click OK or Save to apply the password. Mac will ask you to enter the password a second time to confirm. Type it again and click OK. The file is now protected.

What happens when someone tries to open your protected file

When you or anyone else tries to open a password-protected Excel file, a dialog box appears before the spreadsheet loads. It says "Password" with a single text field. The person must type the correct password to proceed. If they type the wrong password and click OK, Excel shows an error message and returns to the password prompt. They can try again, but there is no limit to how many attempts they get.

This is different from password-protecting a specific sheet or range within Excel — that feature prevents editing but allows viewing. File-level password protection (what this guide covers) prevents opening the file at all.

Choosing a password that is strong but memorable

A strong password is harder to guess and takes longer to crack. Use at least 8 characters, and mix uppercase letters, lowercase letters, numbers, and symbols (like ! or #). For example: BlueSky2024! is stronger than password123.

Write your password down on paper and store it somewhere safe — a locked drawer, a safe, or a notebook you keep at home. Do not store it in a text file on your computer, because if someone gains access to your computer, they can find it. Do not email it to yourself or text it to your phone. If you forget your password, there is no way to recover it or access the file. Microsoft cannot unlock it for you, and no tool can break the encryption without the password.

Removing password protection from a file

If you want to remove the password later, open the file and enter the password when prompted. Once the file is open, go to File > Info > Protect Workbook > Encrypt with Password again. This time, the password field will be empty. Leave it blank and click OK. The password protection is removed, and the file will open without a password from that point forward.

You must know the current password to remove it. If you have forgotten the password, you cannot open the file to remove the protection.

Common mistakes to avoid

Do not rely on password protection as your only security measure. Password protection encrypts the file, but it does not prevent someone from copying the file to another location. They simply cannot open the copy without the password. If someone has physical access to your computer or your network, they can still copy the file — they just cannot read it.

Do not use a password you use for other accounts, like your email or banking password. If someone cracks your Excel password, you do not want them to have access to other important accounts. Do not use obvious passwords like your name, birthday, or the word "password." These are the first things someone will try.

Do not forget to save the file after setting the password. Excel will prompt you to save, but if you close the file without saving, the password protection will not be applied. The next time you open the file, there will be no password prompt.

Frequently Asked Questions

Can I password protect just one sheet in my workbook instead of the whole file?

Yes. Right-click the sheet tab at the bottom of the screen and select "Protect Sheet." This prevents people from editing that sheet, but they can still open the file and view other unprotected sheets. This is different from file-level password protection, which prevents opening the file at all. Use sheet protection when you want to share a workbook but lock down specific tabs.

What if I forgot my password?

There is no built-in recovery method. Microsoft does not store your password and cannot unlock the file for you. If the file is important, you may be able to hire a data recovery service, but this is expensive and not may provide to work. The best approach is to prevent this by writing your password down and storing it safely before you need it.

Does password protection work if I save the file as a different format, like CSV or PDF?

No. If you save a password-protected Excel file as CSV, PDF, or another format, the password protection is removed. The new file will have no password. This is because those formats do not support Excel's encryption. If you need to keep the file protected, save it as .xlsx (the standard Excel format).

Can someone crack my Excel password?

Older versions of Excel (2003 and earlier) had weak encryption that could be cracked with specialized software. Excel 2007 and newer use much stronger encryption. With a strong password (at least 8 characters with mixed types), cracking it would take an extremely long time with current technology. A weak password like "123456" could be cracked much faster.

Does the password protect my file if I upload it to OneDrive or Google Drive?

Yes. The password protection is built into the file itself, not dependent on where it is stored. If you upload a password-protected Excel file to OneDrive, Google Drive, or any other cloud service, it remains password-protected. Anyone who downloads it will need the password to open it.