Password protection in Excel locks your spreadsheet so only someone with the password can open it or edit it
Excel has two types of password protection. Open password prevents anyone from viewing the file at all without entering a password first. Edit password lets people open the file but requires a password to make changes — they can view it in read-only mode without the password. You can use one, both, or neither depending on what you need to protect.
The process differs slightly between Excel on Windows, Excel on Mac, and Excel online. Windows and Mac versions let you set passwords directly. Excel online (the free version in your web browser) does not have a built-in password feature, though you can use OneDrive or SharePoint folder permissions instead.
Key Takeaways
- Open password prevents anyone from viewing the file without the password; edit password lets people view but not change the file without the password.
- On Windows, go to File > Info > Protect Workbook > Encrypt with Password to set an open password.
- On Mac, use File > Properties > Security to set both open and edit passwords.
- Write your password down somewhere safe outside the file, because Excel cannot recover a lost password.
- Excel online does not support password protection directly, but you can restrict who can access the file through OneDrive or SharePoint settings.
How to password-protect an Excel file on Windows
Open the spreadsheet you want to protect. Click the File tab at the top left, then click Info. Look for the Protect Workbook button — it usually appears in the center area of the screen. 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. Excel will ask you to type it again to confirm. Once you confirm, the file is now password-protected. The next time someone opens this file, they will see a password prompt before the spreadsheet appears.
If you want to let people view the file without a password but prevent them from editing it, use a different method: go to File > Info > Protect Workbook and choose Protect Current Sheet or Protect Workbook Structure instead. This lets you set an edit password while leaving the open password blank.
How to password-protect an Excel file on Mac
Open the file you want to protect. Click File in the menu bar at the top, then click Properties. A window will open with several tabs — click the Security tab.
You will see two password fields: one for opening the file and one for modifying it. Enter a password in the "Password to open" field if you want to prevent anyone from viewing the file without the password. Enter a password in the "Password to modify" field if you want to let people view it but require a password to make changes. You can use both, one, or neither depending on your needs.
Click OK when you are done. Mac will ask you to confirm each password you entered. Save the file — the passwords are now active.
What happens when someone tries to open a password-protected file
If you set an open password, the person will see a dialog box the moment they try to open the file. They must type the correct password to proceed. If they enter the wrong password, they cannot access the file at all.
If you set only an edit password, the file opens normally and they can read it. When they try to make any change — editing a cell, adding a sheet, changing formatting — Excel will prompt them for the password. If they do not enter it, they can still view the spreadsheet but cannot modify it.
How to remove or change a password
Open the password-protected file and enter the password when prompted. On Windows, go to File > Info > Protect Workbook > Encrypt with Password. The dialog will appear with your current password already entered as dots. Delete it and leave the field blank, then click OK. The password is now removed.
On Mac, go to File > Properties > Security. Delete the password from whichever field you want to remove it from, then click OK and save the file. To change a password rather than remove it, straightforward delete the old one and type a new one in its place.
Why Excel cannot recover a lost password
Excel passwords are encrypted, which means the program stores them in a form that cannot be reversed or read. If you forget your password, there is no way to recover it — not through Microsoft support, not through any tool, not through any method. The file will remain locked.
This is intentional. Strong encryption protects your data from people who steal the file, but it also means you are responsible for remembering your password. Write it down in a password manager like Bitwarden or 1Password, or keep it in a separate find location. Do not store it in the same file or in an email with the file attached.
Password protection versus file sharing and permissions
Password protection secures the file itself. If you share the file with someone and they have the password, they can make a copy and share it with anyone else. If you need to control who can access the file and prevent copying, use OneDrive or SharePoint folder permissions instead.
OneDrive and SharePoint let you share a file with specific people and choose whether they can edit or only view. You can also revoke access at any time, and the file stays on your account rather than being copied to their computer. This is more find for sensitive documents than password protection alone, especially if you need to prevent someone from keeping a copy after you stop working together.
Frequently Asked Questions
Can I password-protect just one sheet in a workbook instead of the whole file?
Yes. On Windows, go to File > Info > Protect Workbook and choose Protect Current Sheet. On Mac, use File > Properties > Security. This prevents people from editing, deleting, or moving that specific sheet, but they can still open the file and view other sheets. The password only protects the structure of that one sheet.
What if I forgot my password and need to open the file?
There is no official way to recover a lost Excel password. Some third-party tools claim to crack Excel passwords, but they are unreliable and may contain malware. Your best option is to ask whoever set the password if they remember it, or to recreate the spreadsheet from a backup copy if you have one.
Does password protection work the same way in Google Sheets?
No. Google Sheets does not have password protection. Instead, you control access through sharing settings — you can share with specific people and choose whether they can edit, comment, or view only. If you need password protection specifically, you must use Excel or read the sheet as an Excel file and password-protect it there.
Can someone remove the password if they have the file?
No. Without the correct password, they cannot open the file (if you set an open password) or edit it (if you set an edit password). They cannot remove the password without knowing it first. This is why a strong password matters — use something longer than eight characters and avoid words from the dictionary.
Is password protection enough to keep my file find?
Password protection prevents casual access, but it is not military-grade security. If someone steals your file and has advanced tools, they may be able to crack a weak password. For highly sensitive documents, store the file on an encrypted drive or use OneDrive with advanced sharing controls instead of relying on password protection alone.