Password protection in Excel works two ways: you can lock the entire file so nobody opens it without a password, or you can lock specific sheets within a file so people can open the file but cannot edit certain tabs
The method you choose depends on what you are protecting. If the spreadsheet contains sensitive data that should not be seen at all — client lists, financial records, personal information — you password-protect the whole file. If you are sharing a workbook where most people need to see the data but only certain people should edit specific sheets, you lock individual sheets instead.
Both methods use the same basic principle: Excel encrypts the file or sheet with a password you create, and anyone trying to open or edit it must enter that password first. The password itself is not stored in the file — only a code that proves the correct password was entered.
Key Takeaways
- File-level passwords prevent anyone from opening the spreadsheet without entering the password you set.
- Sheet-level passwords let people open the file but prevent them from editing, deleting, or unhiding specific sheets you protect.
- You set file passwords through File > Info > Protect Workbook, and sheet passwords through the Review tab.
- If you forget a password, there is no built-in recovery method — Excel cannot retrieve it for you.
- Password protection in Excel is not military-grade encryption; it is suitable for preventing casual access, not for protecting classified information.
How to password-protect an entire Excel file
To lock the whole file so it cannot be opened without a password, go to the File menu and click Info. On the right side of the screen, you will see a button labeled "Protect Workbook" with a dropdown arrow next to it. Click that dropdown and select "Encrypt with Password."
A dialog box will appear asking you to enter a password. Type the password you want to use — it can be letters, numbers, and symbols, and it is case-sensitive, meaning Excel treats "MyPassword" differently from "mypassword." Click OK. Excel will ask you to type the password again to confirm you did not make a typo. Once you confirm, save the file. The next time anyone tries to open it, they will see a password prompt before the spreadsheet appears.
This method works the same way in Excel for Windows and Excel for Mac, though the exact menu location may shift slightly between versions. If you are using Excel Online (the web version), file-level password protection is not available through the standard interface — you would need to download the file, protect it in the desktop version, and upload it again.
How to password-protect individual sheets
If you want people to open the file but prevent them from editing, moving, or deleting a specific sheet, use sheet-level protection instead. Click the sheet tab you want to protect at the bottom of the screen. Then go to the Review tab in the ribbon at the top, and click "Protect Sheet."
A dialog box will appear with options for what you want to allow. By default, Excel checks "Select locked cells" and "Select unlocked cells," which means people can click around the sheet but cannot change anything. You can uncheck these if you want to prevent even viewing certain cells, though that is less common. Below those options is a password field. Type the password you want to use for this sheet — it can be different from any file-level password — and click OK. Confirm the password when prompted.
You can protect multiple sheets in the same file by repeating this process for each sheet tab. Each sheet can have its own password, or you can use the same password for all of them. When someone tries to edit a protected sheet, they will see a message saying the sheet is protected and asking them to enter the password if they have one.
What password protection actually prevents
Excel password protection stops casual editing. Someone cannot accidentally (or intentionally) change data, delete rows, insert columns, or modify formulas on a protected sheet without the password. They cannot unhide hidden rows or columns, rename the sheet, or move it to another position in the workbook.
What it does not do is hide the data itself. If a sheet is protected but not encrypted, someone can still see all the cell contents — they just cannot change them. If you need to hide the actual data from view, you need file-level encryption, not just sheet protection.
It is also important to know that Excel password protection is not cryptographic security. It is designed to prevent accidental changes and casual tampering, not to protect against someone determined to break in. If security is critical — if you are protecting classified information or financial data that could be worth significant money to crack — you should consider additional security measures beyond Excel's built-in tools, such as storing the file in an encrypted folder or using a dedicated secure storage service.
How to remove or change a password
If you want to remove a sheet-level password, go back to the Review tab and click "Unprotect Sheet." If the sheet has a password, Excel will ask you to enter it. Type the password and click OK. The sheet is now unprotected and anyone can edit it.
To remove a file-level password, go to File > Info > Protect Workbook > Encrypt with Password. The dialog will appear with the password field empty. Leave it blank and click OK. Save the file. The encryption is now removed.
To change a password rather than remove it, follow the same steps as setting a new password — the new password will replace the old one. Excel does not ask you to enter the old password first; it simply overwrites it.
What happens if you forget the password
Excel does not have a password recovery feature. If you set a password and forget it, there is no official way to open the file or unprotect the sheet. Microsoft cannot retrieve it for you, and Excel will not let you bypass it.
Third-party tools exist that claim to crack or remove Excel passwords, but their reliability varies widely, and using them carries security risks — some are malware. If the file is important, your best option is to check whether you wrote the password down somewhere, or whether someone else in your organization has a copy of the unprotected file.
For this reason, if you are protecting a file that you or your organization will need long-term, write the password down and store it somewhere secure — a password manager, a locked drawer, or a secure company system. Do not store it in an email or a text file on your computer.
Password protection across different Excel versions and platforms
File-level and sheet-level password protection work in Excel 2016 and later on Windows, Excel 2016 and later on Mac, and Excel Online (though with some limitations). The steps are the same across versions, though the exact location of buttons in the ribbon may vary slightly.
If you protect a file in a newer version of Excel and open it in an older version, the protection usually remains intact — the older version will still ask for the password. However, some advanced protection settings may not be recognized by older versions. If you are sharing protected files with people using different Excel versions, test it first to make sure the protection works as expected on their system.
Frequently Asked Questions
Can I password-protect just one cell or a range of cells?
Not directly. Excel protects entire sheets, not individual cells. However, you can protect a sheet and then unlock specific cells before protecting, so those cells remain editable while the rest of the sheet is locked. To do this, select the cells you want to keep editable, right-click, choose Format Cells, go to the Protection tab, and uncheck "Locked." Then protect the sheet as normal.
What is the difference between protecting a sheet and protecting a workbook?
Sheet protection locks specific tabs so they cannot be edited without a password. Workbook protection (sometimes called structure protection) prevents people from adding, deleting, renaming, or moving sheets, but does not prevent editing the data within sheets. You can use both at the same time for different purposes.
If I password-protect a file, can someone still see the formulas in my cells?
Yes. Password protection prevents editing, but it does not hide formulas from view. If someone opens the file with the password, they can click any cell and see the formula in the formula bar. If you need to hide formulas, you must lock those cells and then protect the sheet, which prevents people from clicking into them and seeing the formula.
Does password protection work if I save the file as a PDF or CSV?
No. Password protection is specific to Excel files (.xlsx, .xls, .xlsm). If you save the file in another format, the protection is lost. The data itself is exported, but the password lock does not transfer.
Can I use the same password for multiple files?
Yes, you can use the same password for as many files as you want. However, if someone cracks or guesses that password, they will have access to all of them. For important files, use unique passwords for each one.