Password protection in Excel works differently depending on whether you want to lock the file itself or just the sheets inside it
Excel offers two separate password features. You can password-protect the entire file so nobody can open it without the password, or you can password-protect individual sheets so people can open the file but cannot edit specific sheets. Most people want file-level protection — locking the whole spreadsheet. Sheet-level protection is useful when you want to share a file but prevent changes to certain tabs.
The steps differ slightly between Windows and Mac, and between Excel desktop and Excel online. Desktop Excel (the version you install on your computer) has full password features. Excel online (the version in your web browser) can only password-protect the file itself, not individual sheets.
Key Takeaways
- File-level passwords prevent anyone from opening the spreadsheet without entering the password first.
- Sheet-level passwords let people open the file but prevent them from editing, deleting, or moving specific sheets.
- Desktop Excel supports both file and sheet passwords; Excel online supports file passwords only.
- Passwords in Excel are case-sensitive, so "Password" and "password" are different.
- If you forget your password, Excel cannot recover it — there is no reset option.
How to password-protect an entire Excel file on Windows
Open the file you want to protect. Click File in the top left, then click Info. On the right side, you will see a button labeled Protect Workbook with a dropdown arrow next to it. Click the arrow and select Encrypt with Password.
A dialog box will appear asking you to enter a password. Type your password in the field. Excel does not show the characters as you type — you will see dots instead. Click OK. Excel will ask you to enter the password again to confirm it. Type it exactly the same way (passwords are case-sensitive) and click OK. Save the file. The next time someone opens this file, they will be prompted to enter the password before they can see any content.
How to password-protect an entire Excel file on Mac
Open the file you want to protect. Click File in the menu bar at the top, then click Info. Look for the section labeled Protect Workbook and click Encrypt with Password.
A dialog box will appear. Enter your password and click OK. Excel will ask you to re-enter the password to confirm. Type it again exactly as you did the first time and click OK. Save the file using File > Save or by pressing Command+S. The password protection is now active.
How to password-protect individual sheets in Excel
Sheet-level protection prevents people from editing, deleting, or moving a specific sheet, but they can still open the file and view other sheets. Right-click on the sheet tab at the bottom of the screen that you want to protect. Select Protect Sheet from the menu.
A dialog box will open. You will see a list of actions that users can perform (like "Select locked cells" or "Sort"). By default, most actions are blocked. You can check or uncheck boxes to allow specific actions if you want. Enter a password in the field at the bottom if you want one — this is optional for sheet protection. Click OK, re-enter the password if you created one, and click OK again. The sheet is now protected.
How to password-protect a file in Excel online
Open your file in Excel online (the version you access through Office.com or OneDrive). Click File in the top left corner. Click Info. You will see an option labeled Protect Workbook. Click it and select Encrypt with Password.
Enter your password in the dialog box and click OK. Re-enter the password to confirm and click OK again. The file is now password-protected. Anyone who tries to open it will need to enter the password first. Note that Excel online does not support sheet-level password protection — only file-level protection is available.
Removing or changing a password
To remove a file-level password, open the file and go to File > Info > Protect Workbook > Encrypt with Password. The dialog box will appear with your password field empty. Leave it blank and click OK. Save the file. The password is now removed.
To change a password, follow the same steps but enter your new password instead of leaving the field blank. To remove sheet-level protection, right-click the sheet tab and select Unprotect Sheet. If you set a password for that sheet, you will be asked to enter it before the sheet is unprotected.
What happens when someone tries to open a password-protected file
When a file-level password is set, the file will not open at all without it. The person opening the file will see a password prompt before the spreadsheet appears. They must enter the exact password (matching uppercase and lowercase letters) to proceed. If they enter the wrong password, they can try again, but they cannot view any part of the file without the correct password.
With sheet-level protection, the file opens normally, but protected sheets show a lock icon on their tab. Users can see the sheet name and navigate to it, but they cannot edit cells, insert rows or columns, delete the sheet, or perform other protected actions. If a password was set for the sheet, they will be prompted to enter it if they try to unprotect the sheet.
Important things to know about Excel passwords
Excel passwords are case-sensitive, meaning "MyPassword" is different from "mypassword". Write down your password somewhere safe — if you forget it, there is no way to recover it or reset it. Microsoft cannot unlock a password-protected file for you, and no built-in recovery method exists.
Password protection in Excel is not military-grade encryption. It is designed to prevent accidental changes or casual access, not to protect highly sensitive data from determined attackers. If you are protecting financial records or confidential information, consider additional security measures beyond Excel's built-in password feature. Also note that if someone has access to your computer while the file is open, they can see and edit the contents regardless of the password.
Frequently Asked Questions
Can I password-protect just one sheet and leave others unprotected?
Yes. You can protect some sheets and leave others unprotected in the same file. Right-click each sheet tab individually and select Protect Sheet for the ones you want to lock. Sheets you do not protect will remain fully editable.
What if I forget my Excel file password?
There is no built-in recovery method. Excel cannot reset or retrieve lost passwords. You will not be able to open the file. To avoid this, store your password in a password manager or write it down in a secure location.
Can I password-protect an Excel file on my phone or tablet?
Excel mobile apps (for iPhone, iPad, or Android) do not have built-in password protection features. You can open password-protected files created on desktop Excel, but you cannot set or change passwords from the mobile app. Use desktop Excel to set up password protection.
Does password protection work if I save the file as a different format, like CSV?
No. If you save an Excel file as CSV, PDF, or another format, the password protection is lost. The new file will be unprotected. Always save password-protected files in Excel format (.xlsx or .xls) to keep the protection active.
Can two people have different passwords for the same file?
No. A file has one password. Everyone who opens it must enter the same password. If you need different access levels for different people, you would need to create separate files with different passwords, or use sheet-level protection to lock specific sheets.