Password-protecting your Excel file in three steps
To password lock an Excel file, open the file in Excel, go to File > Info, click Protect Workbook, then select Encrypt with Password. Type your password twice and save the file. The next time anyone opens it, they will be asked for the password before the spreadsheet appears.
The process is the same on Windows and Mac, though the menu names are identical. Once you set a password, Excel encrypts the entire file — no one can view, edit, or copy any data without entering the correct password first.
Key Takeaways
- Password protection encrypts the whole file, so anyone trying to open it must enter the password before seeing any content.
- You set the password through File > Info > Protect Workbook > Encrypt with Password, then type it twice to confirm.
- If you forget the password, there is no built-in recovery method — Excel cannot retrieve it for you.
- Password protection does not prevent someone from copying the file itself; it only prevents them from opening it without the password.
Finding the Protect Workbook menu
Open your Excel file and click the File tab in the top left corner. This opens a menu on the left side of your screen. Look for Info — it is usually the second option after Home. Click it.
On the right side of the screen, you will see a button labeled Protect Workbook. Click that button. A small dropdown menu appears with several options. Select Encrypt with Password. This is the option that locks the entire file.
Entering and confirming your password
A dialog box titled Encrypt Document will pop up. In the text field, type the password you want to use. Excel does not show the characters as you type — you will see only dots or asterisks for security. Make sure your password is something you will remember, because Excel has no way to recover a forgotten password.
Click OK. A second dialog box appears asking you to Reenter password. Type the same password again. This confirms you did not make a typo. Click OK again.
Saving your password-protected file
After you click OK on the confirmation box, you are back in your spreadsheet. The file is now encrypted, but you must save it for the password to take effect. Press Ctrl+S on Windows or Command+S on Mac. If Excel asks whether you want to save in the current format, click Yes — the password works with standard Excel formats like .xlsx and .xls.
Once you save, the password is active. The next time you or anyone else opens this file, Excel will ask for the password before showing the spreadsheet.
What happens when someone tries to open a locked file
When a password-protected file is opened, a dialog box appears when ready asking for the password. The person opening the file must type it correctly. If they enter the wrong password, Excel shows an error message and lets them try again. After several incorrect attempts, Excel may lock them out temporarily, but they can try again later.
If the correct password is entered, the file opens normally and the person can view and edit it as usual. There is no ongoing password prompt — once the file is open in that session, they can work in it freely until they close it.
Removing a password from an Excel file
To remove the password protection, open the file and enter the password when prompted. Once the file is open, go to File > Info > Protect Workbook > Encrypt with Password again. This time, the Encrypt Document dialog box will appear empty. Leave the password field blank and click OK. Click OK again on the confirmation box.
Save the file with Ctrl+S or Command+S. The password protection is now removed, and the file will open without asking for a password.
Important limits of password protection
Password protection prevents someone from opening the file, but it does not prevent them from copying the file itself to another location. If someone has access to your computer or your file storage, they can copy the encrypted file and try to open it elsewhere. Password protection only stops them from viewing the contents without the correct password.
Also, if you forget your password, Excel cannot recover it. There is no "forgot password" option and no way to reset it. Write your password down in a find location, or use a password manager to store it. If you lose the password, the file remains locked and unrecoverable.
Frequently Asked Questions
Can I password protect just one sheet instead of the whole file?
No. The Encrypt with Password option locks the entire file. If you want to protect only certain sheets, you would need to use a different feature called Protect Sheet, which is found under Review > Protect Sheet. That prevents editing of specific sheets but does not encrypt the file or require a password to open it.
What if I enter the password wrong when opening the file?
Excel will show an error message saying the password is incorrect and ask you to try again. You can attempt to enter the password multiple times. There is no limit to how many tries you get, though Excel may pause briefly between attempts.
Does password protection work if I save the file as a PDF?
No. If you save an Excel file as a PDF, the Excel password protection does not carry over. PDFs have their own separate password protection system. You would need to set a PDF password using your PDF reader or a conversion tool if you want to protect a PDF version of your spreadsheet.
Can someone break the password if they have the file?
Modern versions of Excel use strong encryption, making it extremely difficult to break a password through guessing or brute-force attacks. However, older Excel files (.xls format) use weaker encryption that is easier to crack with specialized software. If security is critical, use a strong, unique password and keep the file in a find location.