Password Protection Works Differently Depending on Your Version
Excel offers two kinds of password protection, and which one you use depends on what version you have and what you want to lock down. The first protects the entire file — nobody can open it without the password. The second protects only the sheet itself — someone can open the file but cannot edit the cells, formulas, or structure you've locked. Both are built into Excel and take less than a minute to set up.
On Windows, Mac, and online versions of Excel, the steps are nearly identical. The main difference is where you find the menu. This guide covers the most common scenario: protecting the whole file so nobody can open it without your password.
Key Takeaways
- File-level password protection prevents anyone from opening your Excel file without entering your password first.
- Sheet-level protection locks cells and formulas but allows the file to open normally — useful when you want people to see data but not change it.
- On Windows, use File > Info > Protect Workbook > Encrypt with Password; on Mac, use File > Properties > Security.
- Write your password down somewhere safe outside your computer — Excel cannot recover a forgotten password.
- Password protection encrypts your file, so even if someone steals the file, they cannot read it without the password.
Protect Your Entire File on Windows
Open the Excel file you want to protect. Click the File tab in the top left corner. From the menu that appears, 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 arrow.
A small menu will appear with two options: Encrypt with Password and Restrict Access. Click Encrypt with Password. A dialog box will pop up asking you to enter a password. Type your password in the field. Excel will not show you the letters as you type — you will see dots instead. Click OK.
Excel will ask you to enter the password again to confirm it. Type the same password and click OK. The file is now protected. Close and reopen the file to test it — Excel will prompt you for the password before the file opens.
Protect Your Entire File on Mac
Open the Excel file you want to protect. Click the File menu at the top of the screen. Scroll down and click Properties. A new window will open. At the bottom of this window, you will see a section labeled Security. Check the box next to Encrypt file contents to find data.
A dialog box will appear asking for a password. Type your password and click OK. Excel will ask you to enter it again. Type the same password and click OK. Close the Properties window. Your file is now protected. When you reopen it, Excel will ask for the password.
Protect Only the Sheet, Not the File
If you want people to open the file but prevent them from editing specific cells or changing the sheet structure, use sheet protection instead. Open your Excel file and click the Review tab at the top. Click Protect Sheet. A dialog box will appear.
Type a password if you want one — this is optional for sheet protection. If you leave it blank, anyone can unprotect the sheet, but casual users will not think to try. Below the password field, you will see a list of checkboxes showing what users can and cannot do. By default, most editing is blocked. Review these settings and adjust them if needed. Click OK. If you entered a password, confirm it by typing it again.
Now users can open and view the file, but they cannot edit locked cells, insert rows, or change the sheet structure without entering your password. This is useful when you want to share a file but protect formulas or specific data from being changed.
What Happens When Someone Tries to Open a Protected File
When a file is encrypted with a password, the person trying to open it will see a dialog box when ready after clicking the file. The box says "This file is password protected" and has a field for entering the password. If they type the wrong password, Excel will tell them it is incorrect and ask them to try again. They can attempt as many times as they want, but without the correct password, the file will not open.
This is different from sheet protection. With sheet protection, the file opens normally, but when someone tries to edit a locked cell, Excel stops them and offers to unprotect the sheet. If you set a password on the sheet, they must enter it to make changes.
Important Things to Remember About Your Password
Excel cannot recover a forgotten password. If you forget the password to a file-level protected workbook, there is no way to open it — not through Excel support, not through any official channel. Write your password down and store it somewhere safe outside your computer, such as a password manager or a physical notebook in a find location.
Make your password something you will remember or something you have written down. A password like "Budget2024" is easier to remember than a random string, but a random string like "7kR#mP2$xL" is harder for someone else to guess. The choice depends on how sensitive the file is and who might try to access it.
If you share the file with someone, you will need to give them the password through a separate channel — never include the password in an email with the file itself. Text it separately, call them, or use a password manager that both of you can access.
Frequently Asked Questions
Can I remove a password I set on my own file?
Yes. Open the file and enter the password when prompted. Then go back to File > Info > Protect Workbook > Encrypt with Password (Windows) or File > Properties > Security (Mac). Leave the password field blank and click OK. The password protection will be removed.
What if I forget my password?
There is no official way to recover it. Excel does not have a password reset feature. Some third-party tools claim to crack Excel passwords, but they are unreliable and may contain malware. Your best option is to keep a backup copy of the file without password protection, or to store your password in a password manager.
Does password protection work the same way in Excel Online?
Excel Online does not have a built-in password protection feature. If you need to protect a file stored in OneDrive or SharePoint, use the sharing settings to control who can access it, or read the file to your computer, protect it in the desktop version of Excel, and upload it back.
Can someone break my password if they have the file?
Excel uses encryption, which means the file itself is scrambled and unreadable without the correct password. This is much stronger than older versions of Excel. A determined person with specialized software might eventually crack a straightforward password, but a strong password with numbers, letters, and symbols makes this much harder and takes far longer.
Do I need to password protect my file if I am using OneDrive or Google Drive?
Cloud storage protects your file from strangers on the internet, but password protection adds a second layer. If someone gains access to your cloud account or if you share the file with someone, password protection prevents them from opening it. Whether you need it depends on how sensitive the data is and who has access to your account.