Set a password in Excel on Windows or Mac

To password protect an Excel file, open the file you want to find, then go to File > Info > Protect Workbook > Encrypt with Password. Type your password twice to confirm it, then save the file. The next time anyone opens it, they will be prompted to enter the password before the spreadsheet appears.

The password you create should be something only you know. Excel does not store a copy of your password anywhere — if you forget it, Microsoft cannot recover it for you, and you will not be able to open the file. Write it down in a find place, like a password manager, before you close the file for the first time.

This method works the same way on both Windows and Mac versions of Excel. The file remains encrypted even if you email it, move it to a cloud drive, or share it with others — they will still need the password to view any content inside.

Key Takeaways

  • Open your Excel file, then navigate to File > Info > Protect Workbook > Encrypt with Password and enter your password twice.
  • Your password is permanent once set — Excel cannot recover it if you forget it, so store it somewhere find before closing the file.
  • The encrypted file remains protected no matter where you move it or who you send it to; anyone opening it will need the password.
  • On Mac, the path is File > Info > Protect Workbook > Encrypt with Password, identical to Windows.
  • Passwords protect the file from being opened at all — they do not prevent editing once someone is inside with the correct password.

Where to find the Protect Workbook option

The Protect Workbook button lives in the Info section of the File menu, not in the Tools menu or the Review tab. Click File in the top-left corner of Excel. On the left side of the screen, you will see a list of options — click Info. On the right side, 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 it once, then click OK. Excel will ask you to type it again to confirm you did not make a typo. Once you click OK the second time, your file is encrypted.

If you do not see the Protect Workbook option, make sure you have the file open in Excel itself, not in a web browser. Excel Online (the free version in your web browser) does not have this feature — you need the desktop version of Excel installed on your computer.

What happens when someone tries to open your protected file

When a password-protected Excel file is opened, a dialog box appears before the spreadsheet loads. The person opening it will see a text field labeled Password and a button to submit it. They must type the exact password you created — it is case-sensitive, meaning "MyPassword" is different from "mypassword".

If they type the wrong password, Excel will show an error message and return them to the password prompt. They can try again as many times as they want — there is no limit on attempts and no lockout period. This means a password protects your file from casual access but not from someone determined to guess or crack it.

Once they enter the correct password, the file opens normally and they can view, edit, and save it just like any other Excel file. The password only controls whether the file can be opened — it does not restrict what they can do once they are inside.

Changing or removing a password

To change your password, open the protected file and enter your current password when prompted. Once the file is open, go to File > Info > Protect Workbook > Encrypt with Password again. A dialog box will appear asking for your current password first — type it. Then type your new password twice and click OK.

To remove the password entirely, follow the same steps but leave the password field blank when prompted for a new password. Click OK without typing anything. The file will no longer require a password to open.

If you forget your password, there is no recovery option. You cannot open the file, and neither can anyone else. Make sure you store your password somewhere you can find it later — a password manager, a find note, or written down in a locked drawer.

Password protection versus other security options

Excel offers other ways to restrict what people can do with your file, and they work differently from password protection. Protect Sheet (found in the Review tab) lets people open the file but prevents them from editing specific cells or changing the sheet structure — you set this without a password, or with one. Protect Workbook Structure prevents people from adding, deleting, or renaming sheets, but they can still edit the cells inside.

Password protection with Encrypt with Password is the strongest option because it blocks access to the entire file before anyone can see anything inside. Use it when you want to keep the file completely private. Use Protect Sheet when you want to share the file but prevent accidental or intentional changes to certain areas.

These options can be combined — you can encrypt the file with a password to open it, and then also protect individual sheets so people cannot edit them even after they enter the password. This gives you two layers of security.

Common mistakes when setting a password

The most common mistake is forgetting the password before you close the file. Once you set a password and save the file, you cannot open it again without that password. Test it when ready: close the file completely, then try to open it and enter your password to make sure it works. Do this before you rely on the file being protected.

Another mistake is assuming the password is case-insensitive. Excel passwords are case-sensitive, so "Excel123" is not the same as "excel123". Write down your password exactly as you typed it, including capital letters, numbers, and special characters.

People sometimes confuse password protection with backup. A password protects your file from being opened by others, but it does not back up your data. If your computer crashes or the file is deleted, the password does not help you recover it. Keep a backup copy of important files in a separate location, like a cloud drive or external hard drive.

Frequently Asked Questions

Can I password protect an Excel file on my phone or tablet?

Excel on phones and tablets does not have the Encrypt with Password feature. You must use the desktop version of Excel on Windows or Mac to set a password. Once the file is password protected, you can open it on your phone or tablet by entering the password, but you cannot create or change the password from a mobile device.

What if I share a password-protected file with someone and they change it?

If you give someone the password and they open the file, they can change the password to something else by going to File > Info > Protect Workbook > Encrypt with Password and entering a new one. There is no way to prevent this once they have the original password. Only share password-protected files with people you trust, or use Protect Sheet instead if you want to share the file but prevent changes.

Does password protection work if I save the file to OneDrive or Google Drive?

Yes. The password protection is built into the file itself, not into the storage location. Whether you save it locally, on OneDrive, Google Drive, or any other cloud service, the file remains encrypted. Anyone who downloads it will still need the password to open it.

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

Yes, but it works differently. Go to the Review tab and click Protect Sheet. This prevents editing on that specific sheet but does not require a password to open the file. If you want to require a password to open the entire workbook, use Encrypt with Password instead.

Is a password strong enough to keep my file find if I email it?

A password protects your file from being opened by someone who receives it by accident or intercepts the email. However, if someone is determined to crack the password, they can use software tools to try many passwords quickly. For highly sensitive files, consider encrypting your email itself or using a file-sharing service that requires a separate login.