Password protection locks your Excel file so only someone with the password can open it or make changes
Excel has a built-in password feature that encrypts your file. When you set a password, Excel scrambles the contents so that opening the file without the correct password is not possible. You can set one password to open the file, a second password to allow editing, or both. The process takes less than a minute and works the same way whether you use Excel on Windows or Mac.
The password you create is not recoverable if you forget it, so write it down somewhere safe before you close the file. Excel does not have a "forgot password" recovery option — if you lose the password, the file remains locked.
Key Takeaways
- You can set a password to open the file, a password to allow editing, or both at the same time.
- The process is the same on Windows and Mac: go to File, then Info, then Protect Workbook, then Encrypt with Password.
- Write down your password before you close the file, because Excel cannot recover a forgotten password.
- If you share the file with others, tell them the password through a separate message, never in an email with the file itself.
How to set a password on Windows
Open the Excel file you want to protect. Click the File tab in the top left corner. From the menu on the left, click Info.
On the right side of the screen, you will see a button labeled Protect Workbook. Click it, then select Encrypt with Password from the dropdown menu. A dialog box will appear asking you to enter a password. Type your password in the field. The characters will appear as dots for security. Click OK.
Excel will ask you to enter the password again to confirm it. Type the same password and click OK. You will see a message saying the file is now encrypted. Save the file by pressing Ctrl + S or by clicking File and then Save. The password is now active.
How to set a password on Mac
Open the Excel file you want to protect. Click the File menu at the top of the screen. Select Info from the dropdown. On the right side, click the button that says Protect Workbook.
From the menu that appears, click Encrypt with Password. A dialog box will open. Enter your password in the field — it will show as dots as you type. Click OK. Excel will ask you to enter the password a second time to confirm. Type it again and click OK. Save the file by pressing Command + S or by going to File and then Save.
The difference between opening password and editing password
Excel lets you set two different passwords. An opening password prevents anyone from opening the file at all without entering it first. An editing password allows someone to open the file and view it, but they cannot make changes or save the file unless they enter the password.
To set both passwords, follow the steps above but look for an option that says "Protect Structure and Windows" or "Encrypt with Password" — the exact wording depends on your Excel version. Some versions show both password fields in the same dialog. If you see only one password field, you are setting the opening password. To add an editing password as well, you may need to use a different menu option or save the file in a different format.
For most situations, one password is enough. Use an opening password if the file contains sensitive information. Use an editing password if you want to share the file for viewing but prevent accidental or intentional changes.
What to do if you forget the password
Excel does not have a built-in way to recover or reset a forgotten password. If you forget the password to a file you created, the file will remain locked and you will not be able to open it. This is by design — it prevents anyone else from accessing the file even if they have physical access to your computer.
The only way to avoid this is to store your password in a safe place before you close the file. Write it down on paper, store it in a password manager, or send it to yourself in an email. Do not store the password in the same location as the file itself.
How to remove a password from an Excel file
Open the file and enter the password when prompted. Once the file is open, go to File, then Info, then Protect Workbook, and select Encrypt with Password again. The password field will be empty. Leave it blank and click OK. When prompted to confirm, leave the field blank again and click OK. Save the file. The password is now removed.
You must know the current password to remove it. If you have forgotten the password, you cannot remove it without using third-party software, and even then success is not may provide.
How to share a password-protected file safely
If you need to send the file to someone else, send the file and the password through separate channels. For example, email the file in one message and text the password in a separate message, or email the file and tell the person the password in person. This way, if someone intercepts the email, they have only the file or only the password, not both.
Never include the password in the same email, document, or message as the file itself. Also avoid writing the password in a shared document or on a sticky note left near the computer. The password is only find if it stays separate from the file.
Frequently Asked Questions
Can I password protect just one sheet in an Excel workbook instead of the whole file?
Yes. Right-click the sheet tab at the bottom of the screen and select "Protect Sheet". You can then set a password that prevents changes to that sheet while leaving other sheets unprotected. This is useful if you want to lock formulas or headers but allow editing in other areas.
What happens if someone tries to open the file without the password?
Excel will show a dialog asking for the password. If they enter the wrong password, they cannot open the file. They can close the dialog and try again, but there is no limit on attempts — they can keep guessing. This is why a strong password matters.
Does password protecting an Excel file hide the data from view?
No. The password only controls who can open the file or make changes to it. Once someone enters the correct password and opens the file, they can see all the data. If you need to hide specific cells or columns, use Excel's hide feature in addition to the password.
Can I change the password without removing it first?
No. You must remove the old password by opening the file, going to File > Info > Protect Workbook > Encrypt with Password, leaving the field blank, and saving. Then you can set a new password using the same steps.
Is a password-protected Excel file safe to store in cloud services like OneDrive or Google Drive?
Yes. The password encryption happens on your computer before the file is uploaded, so the file remains encrypted in the cloud. However, if you store the password in the same cloud account or in an email, the security is weakened. Keep the password separate from where you store the file.