Password protection locks your Excel file so that only someone who knows the password can open it or make changes
When you password-protect an Excel file, you are encrypting it with a code that Windows or Mac must verify before the file opens. Someone without the password sees only a locked file—they cannot view the spreadsheet, copy data from it, or edit it. Excel offers two types of protection: one password to open the file at all, and a separate password to allow opening but prevent editing. You can use one, both, or neither depending on what you need.
Password protection is useful if your spreadsheet contains financial data, client lists, salary information, or anything else you do not want others to access. It is not the same as sharing permissions—a password protects the file itself, not just who has access to a folder or cloud account. If someone steals your laptop or finds the file on a shared drive, the password is what stops them from reading it.
Key Takeaways
- Excel lets you set a password to open the file and a separate password to allow editing, or use just one of these.
- The process takes under a minute and works the same way on Windows and Mac, though the menu names differ slightly.
- If you forget the password, there is no built-in recovery—you cannot open or edit the file without it, so write it down somewhere safe.
- Password protection encrypts the file itself, so it works even if the file is shared on a drive or email, unlike folder-level permissions.
How to set a password on Windows
Open the Excel file you want to protect. Click the File menu in the top left, then select Info. You will see a button labeled Protect Workbook with a dropdown arrow next to it. Click that arrow and choose Encrypt with Password.
A dialog box will appear asking you to enter a password. Type the password you want to use—Excel does not show the characters as you type, so type carefully. Click OK. Excel will ask you to type the password again to confirm it. Type it exactly the same way, then click OK again. Save the file. The next time anyone tries to open it, they will see a password prompt before the spreadsheet appears.
How to set a password on Mac
Open the Excel file and click File in the menu bar at the top. Select Info, then look for Protect Workbook. Click the dropdown next to it and choose Encrypt with Password.
Type your password in the box that appears. Remember that Excel hides what you type, so enter it slowly and carefully. Click OK, then type the password again when prompted to confirm. Save the file using File > Save or by pressing Command+S. The password is now active.
The difference between opening passwords and editing passwords
Excel actually offers two separate password options. An opening password (sometimes called an encryption password) prevents anyone from viewing the file at all without the correct password. An editing password allows someone to open and view the file, but they cannot make changes or save it under the same name without entering a second password.
To set both passwords, use the same steps above but look for Protect Workbook > Encrypt with Password for the opening password. For the editing password, choose Protect Workbook > Protect Current Sheet or Protect Workbook Structure depending on what you want to lock. This is useful if you want colleagues to see data but not change it, or if you want to prevent accidental edits to formulas.
What happens when someone tries to open a password-protected file
When a password-protected Excel file is opened, the person sees a dialog box asking for the password before anything else appears. They must type the correct password to proceed. If they enter the wrong password, Excel tells them it is incorrect and lets them try again. There is no limit to how many times they can try, so a weak password can be guessed.
If the file has only an editing password, the person can open and read the spreadsheet, but when they try to save changes, Excel prompts them for the editing password. They can view everything but cannot modify the file without the password.
How to remove or change a password
To remove a password, open the file and enter the password when prompted. Go to File > Info > Protect Workbook > Encrypt with Password. The password field will be empty or show dots. Delete any content in that field and leave it blank, then click OK. Save the file. The password is now removed.
To change the password, follow the same steps but enter a new password instead of leaving the field blank. Confirm the new password when prompted and save the file. The old password will no longer work.
Why password protection is not the same as file permissions
If your Excel file sits on a shared network drive or cloud storage like OneDrive or SharePoint, you might think folder permissions are enough. They are not. Folder permissions control who can see the file exists and who can read it, but once someone has the file on their computer, folder permissions no longer explore. Password protection encrypts the file itself, so it stays locked no matter where it goes or who has a copy.
This is why password protection matters for sensitive data. You can share a file with someone via email or a shared drive, and the password ensures only the intended person can open it. Folder permissions alone do not provide that protection once the file leaves the folder.
Important things to know before you password-protect a file
If you forget the password, Excel cannot recover it for you. There is no "forgot password" option, no recovery email, and no way to bypass it. You will not be able to open or edit the file. Write down your password and store it somewhere safe—a password manager, a locked drawer, or another find location. Do not store it in a text file on the same computer as the Excel file.
Password protection works on all versions of Excel that support it, including Excel Online, but the steps may look slightly different. If you share a password-protected file with someone using an older version of Excel, they should still be able to open it if they have the password, though some features may not work the same way. Test this before relying on it for important workflows.
Frequently Asked Questions
Can I password-protect just one sheet in a workbook instead of the whole file?
Yes. Go to File > Info > Protect Workbook > Protect Current Sheet. This prevents changes to that specific sheet but does not encrypt the file itself. Someone can still open the workbook and view other sheets. If you want to hide the sheet entirely, use the sheet tab context menu and choose Hide, though hiding is not the same as password protection.
What if I need to share a password-protected file with someone?
Send the file and the password separately. Do not include the password in the same email as the file. Use a phone call, text message, or a separate email sent at a different time. This way, if someone intercepts one message, they do not have both the file and the password.
Does password protection slow down Excel or make the file bigger?
No. Password protection does not noticeably affect file size or performance. The file opens and saves at the same speed as an unprotected file, though you will see the password prompt each time you open it.
Can I password-protect an Excel file that is already shared on OneDrive or SharePoint?
Yes. Password protection works on files stored anywhere—your computer, OneDrive, SharePoint, Google Drive, or a shared network drive. The password encrypts the file itself, so it remains locked regardless of where it is stored or who has access to the folder.
What kind of password should I use?
Use a password that is at least 8 characters long and includes uppercase letters, lowercase letters, numbers, and symbols. Avoid passwords based on your name, birthdate, or common words. Excel passwords are case-sensitive, so "Password" is different from "password"—remember which one you used.