Password protection locks your Excel file so only someone with the password can open it or make changes
Excel has two types of password protection. The first locks the entire file — nobody can open it without the password. The second locks just the sheet itself — people can open the file but cannot edit the cells, formulas, or structure without the password. Most people want the first type, which protects sensitive data from being seen at all.
The steps differ slightly between Excel on Windows, Excel on Mac, and Excel Online. Windows and Mac use the same general approach through the File menu. Excel Online (the free version in your web browser) has limited protection options and cannot lock an entire file — it can only lock individual sheets.
Key Takeaways
- File-level password protection prevents anyone from opening your Excel document without the correct password.
- Sheet-level protection lets people open the file but prevents them from editing cells, deleting sheets, or changing formulas without a password.
- Windows and Mac Excel use the File menu and Save As dialog to set file passwords; the process takes about two minutes.
- Excel Online cannot password-protect an entire file, only individual sheets within it.
- If you forget the password, there is no built-in recovery — write it down or store it in a password manager before you save.
Password protecting an entire Excel file on Windows
Open the file you want to protect. Go to File in the top left, then click Save As. Choose where you want to save the file — you can save it in the same location with the same name, or give it a new name. The location matters because you are about to create a new version with the password.
Before you click the Save button, look for a button labeled Tools near the bottom right of the Save As dialog. Click the small arrow next to it and select General Options. A new window will open with two password fields: one for opening the file and one for modifying it. Type your password in the Password to open field if you want to lock the entire file. Leave the other field blank unless you want a second password that allows people to open the file but not edit it. Click OK, then type your password again to confirm it. Click Save.
From now on, anyone who tries to open this file will see a password prompt before the spreadsheet appears. If they do not enter the correct password, the file will not open at all.
Password protecting an entire Excel file on Mac
Open the file and go to File at the top of the screen. Click Save As. Choose a location and name for your file. Before saving, look for a checkbox labeled Protect with password — it is usually near the bottom of the dialog. Check that box.
A password entry window will appear. Type your password and click OK. You will be asked to type it again to confirm. Once you click Save, the file is protected. The next time anyone opens it, they will need the password.
Protecting just one sheet within a file
Sheet protection is useful when multiple people work on the same file but you want to prevent accidental changes to certain sheets or lock down formulas. The person opening the file can see all the data, but they cannot edit cells, delete rows, or change the sheet structure without the password.
Go to the sheet you want to protect. On Windows, click Review in the ribbon at the top, then click Protect Sheet. On Mac, click Review, then Protect Sheet. A dialog will open asking for a password. Type one in and click OK, then type it again to confirm. The sheet is now protected — cells will be locked and users cannot edit them unless you have specifically unlocked certain cells beforehand.
If you want some cells to remain editable while others are locked, you must unlock those cells before you protect the sheet. Select the cells you want people to edit, right-click, choose Format Cells, go to the Protection tab, and uncheck the Locked option. Then protect the sheet. Now only the cells you unlocked will be editable.
What Excel Online can and cannot do
If you use Excel in your web browser (Excel Online), you cannot password-protect an entire file. You can only protect individual sheets. Click the sheet tab at the bottom, then go to Review and select Protect Sheet. The process is the same as on desktop Excel, but the file itself remains unprotected — anyone with access to your OneDrive or SharePoint folder can still open it.
If you need full file protection, download the file to your computer, password-protect it using desktop Excel, and then upload it back. The password will remain in place when you open it again in Excel Online, though you will need to enter it each time.
Removing or changing a password
To remove file-level protection, open the file (you will need the password). Go to File and Save As. On Windows, click Tools and General Options. On Mac, check the Protect with password box again. Leave the password field blank and click OK. Save the file. The password is now removed.
To remove sheet protection, go to Review and click Unprotect Sheet (Windows) or Unprotect Sheet (Mac). You will be asked for the password. Enter it and the sheet is unprotected.
To change a password, remove the old one using the steps above, then add a new one using the same process you used to create the first one.
Common mistakes and how to avoid them
The most common mistake is forgetting the password. Excel has no password recovery feature — if you lose it, you cannot open the file. Write down your password and store it somewhere safe, like a password manager (Bitwarden, 1Password, or Dashlane all work). Do not store it in a note on your desktop or in an email.
Another mistake is confusing file protection with sheet protection. File protection locks the entire document. Sheet protection only locks the cells within that sheet. If you want to prevent someone from seeing the data at all, use file protection. If you want them to see it but not change it, use sheet protection.
A third mistake is saving the file in a different format after protecting it. If you save an Excel file as a CSV or PDF, the password protection is lost. Keep it as an .xlsx file (or .xls for older versions) to maintain the protection.
Frequently Asked Questions
Can I password protect an Excel file if I do not have the original password?
No. If the file is already protected and you do not know the password, you cannot open it or remove the protection. 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 contact whoever created the file and ask them for the password.
What is the difference between opening password and modifying password?
An opening password prevents the file from being opened at all without it. A modifying password lets someone open the file but prevents them from saving changes to it. If you set only a modifying password, people can view all your data but cannot edit it. Most people use only the opening password.
Does password protecting an Excel file slow it down?
No. Password protection does not affect how fast the file opens or how quickly Excel runs. The only delay is the few seconds it takes to enter the password when you first open the file.
Can I share a password-protected Excel file with someone else?
Yes, but you must give them the password separately. Send the file through email or cloud storage, then tell them the password through a different method — a phone call, text message, or in person. Never include the password in the same email as the file.
Will the password protection stay if I upload the file to Google Drive or OneDrive?
Yes, the password stays in place. When someone downloads the file from the cloud, they will still need the password to open it. However, if they open it directly in Google Sheets or OneDrive's web version, the password protection may not apply — they should download it first to ensure the protection works.