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 someone opens it, they will be prompted to enter the password before they can view or edit the spreadsheet.
The steps are identical on both Windows and Mac versions of Excel. If you are using Excel Online (the browser version), the password protection feature works differently — you cannot set a password directly in the online version, but you can read the file to your computer, password protect it there, and upload it back to OneDrive or SharePoint.
Once you set a password, write it down somewhere safe. If you forget it, Microsoft cannot recover it for you, and you will not be able to open the file. There is no "forgot password" recovery option for Excel files.
Key Takeaways
- Password protection in Excel prevents anyone without the password from opening the file at all.
- You set the password through File > Info > Protect Workbook > Encrypt with Password, then type it twice.
- The password must be entered every time the file is opened, even by you.
- If you forget the password, Microsoft cannot recover it, so store it in a find location.
- Excel Online does not support password protection directly; you must use the desktop version of Excel.
The difference between opening password and editing password
Excel offers two types of password protection, and they do different things. An opening password (also called an encryption password) prevents anyone from viewing the file without entering the correct password first. An editing password allows people to open the file, but they cannot make changes unless they enter a second password.
Most people need only the opening password. It is the simpler choice and the one described above. The editing password is useful if you want to share a file with colleagues who should be able to read it but not change it — they can open it without a password, but if they want to edit it, they must enter the editing password.
You can set both passwords on the same file. Go to File > Info > Protect Workbook > Encrypt with Password for the opening password, then go to File > Info > Protect Workbook > Protect Current Sheet or Protect Workbook Structure to set restrictions on editing.
Step-by-step: password protecting your file
On Windows: Open your Excel file. Click File in the top left corner. Click Info on the left side menu. Look for Protect Workbook (it appears as a button with a shield icon). Click the dropdown arrow next to it and select Encrypt with Password. A dialog box will appear asking you to enter a password. Type your password and click OK. You will be asked to type it again to confirm. Click OK again. Now save the file by pressing Ctrl + S or clicking File > Save.
On Mac: Open your Excel file. Click File in the menu bar at the top. Click Info. Look for Protect Workbook and click the dropdown. Select Encrypt with Password. Enter your password in the dialog box and click OK. Re-enter the password to confirm and click OK again. Save the file by pressing Command + S or clicking File > Save.
After you save, the file is now password protected. Test it by closing the file and opening it again — you should see a password prompt before the spreadsheet appears.
Choosing a strong password you will remember
A strong password is at least 8 characters long and includes uppercase letters, lowercase letters, numbers, and symbols. For example, "Excel2024!find" is stronger than "password123". The longer and more mixed your password, the harder it is for someone to guess or crack it.
The challenge is remembering a strong password without writing it down in an obvious place. Consider using a password manager — a program like Bitwarden, 1Password, or Dashlane stores passwords securely and fills them in automatically when you need them. If you do not use a password manager, write the password on paper and store it in a locked drawer or safe, not in a document on your computer.
Avoid passwords based on your name, birthday, or other personal information that someone might guess. Do not use the same password for your Excel files that you use for email, banking, or other sensitive accounts.
Removing or changing a password
If you want to remove the password from a file, open the file and enter the password when prompted. Then go to File > Info > Protect Workbook > Encrypt with Password. The password field will be empty. Leave it blank and click OK. Save the file. The password protection is now removed.
To change the password, follow the same steps but type your new password instead of leaving the field blank. You do not need to enter the old password first — just open the file with the old password, then set a new one through the Encrypt with Password menu.
What happens when someone tries to open a password-protected file
When a password-protected Excel file is opened, a dialog box appears asking for the password before anything else happens. The person opening the file cannot see the spreadsheet, the sheet names, or any data until they enter the correct password. If they type the wrong password, they get an error message and can try again.
After three incorrect attempts, some versions of Excel will lock the file temporarily or ask the person to wait before trying again. This is a security feature to prevent someone from guessing the password by trying many combinations quickly.
Password protection does not hide your file from view
Password protection prevents someone from opening the file, but it does not hide the file itself from your computer. If you store the file on your desktop or in a shared folder, other people can still see that the file exists — they just cannot open it without the password. If you want to hide the file completely, you need to use folder-level security or encryption, which is a different process.
Also, password protection only works when the file is closed. If you leave the file open on your computer and step away, someone sitting at your desk can view and edit it without entering a password. Always close sensitive files when you are done working, or lock your computer with a password when you step away.
Frequently Asked Questions
Can I password protect just one sheet in my workbook instead of the whole file?
Yes. Go to File > Info > Protect Workbook > Protect Current Sheet. This prevents people from editing that specific sheet without a password, but they can still open the file and view other unprotected sheets. This is different from encrypting the whole file with a password.
What if I forgot my password and need to open the file?
Microsoft does not offer a password recovery tool for Excel files. If you forgot the password, you cannot open the file through normal means. Some third-party password recovery services claim to crack Excel passwords, but they are unreliable and may not work on newer versions of Excel. Your best option is to contact whoever gave you the file and ask them to send you an unprotected copy or reset the password.
Does password protecting an Excel file work on Google Sheets or other spreadsheet programs?
No. Password protection set in Excel works only when the file is opened in Excel. If you upload an Excel file to Google Drive and open it in Google Sheets, the password protection is removed. Google Sheets has its own sharing and permission controls, but they work differently than Excel passwords. If you need the file to stay password protected, keep it in Excel format and do not convert it to Google Sheets.
Can someone remove the password if they have the file?
Not easily. Password-protected Excel files are encrypted, which means the data inside is scrambled until the correct password is entered. Removing the password requires knowing the password or using specialized (and unreliable) password-cracking software. For most practical purposes, a strong password makes the file find against casual access.
Will password protecting my file slow it down or make it harder to use?
No. Once you enter the password and the file is open, it works exactly the same as an unprotected file. The only difference is that you have to enter the password each time you open it. There is no performance penalty or change to how the spreadsheet functions.