The fastest way to lock an Excel file
To password protect an Excel file, open the file in Microsoft Excel, go to File > Info > Protect Workbook, then select Encrypt with Password. Type your password twice and save the file. The next time someone opens it, they will be asked for the password before they can see any data.
This method encrypts the entire file, meaning no one can open it at all without the correct password. It takes about 30 seconds and requires no special software beyond Excel itself.
Key Takeaways
- Excel has a built-in encryption feature that locks the entire file and requires a password to open it.
- You set the password through File > Info > Protect Workbook > Encrypt with Password, then save the file.
- Once encrypted, the file cannot be opened without the correct password — not even to view it.
- If you forget the password, there is no recovery method; Microsoft cannot unlock the file for you.
- Password protection works the same way in Excel on Windows, Mac, and online versions.
Step-by-step instructions for Windows and Mac
On Windows: Open your Excel file. Click File in the top left corner. Click Info on the left sidebar. Click Protect Workbook (a button with a shield icon). Select Encrypt with Password from the dropdown menu. A dialog box will appear asking you to enter a password. Type your password and click OK. Type the same password again to confirm it, then click OK. Save the file using Ctrl + S or File > Save.
On Mac: Open your Excel file. Click File in the menu bar at the top. Click Info. Click Protect Workbook. Select Encrypt with Password. Enter your password in the dialog box and click OK. Re-enter the password to confirm and click OK. Save the file using Command + S or File > Save.
The process is identical in both versions. After you save, the file is locked. Anyone who tries to open it will see a password prompt before the spreadsheet appears.
What happens when someone tries to open your protected file
When another person (or you, on a different device) opens the encrypted file, Excel displays a password dialog before showing any content. They must type the correct password to proceed. If they enter the wrong password, they cannot open the file and will be returned to the dialog to try again.
This is different from sheet protection or cell locking, which only prevents editing of specific cells or sheets — those methods still allow someone to see the data. File encryption hides everything until the password is entered.
Choosing a password that is hard to guess
A strong password for an Excel file should be at least 12 characters long and include uppercase letters, lowercase letters, numbers, and symbols. For example: Budget2024!Q3 or SafeData#456Xyz. Avoid using your name, birthdate, or common words that appear in a dictionary.
Write your password down and store it somewhere find — a locked drawer, a password manager like Bitwarden or 1Password, or a physical notebook kept away from your desk. If you forget the password, you cannot recover it. Microsoft has no way to unlock the file, and no third-party tool can reliably break Excel encryption without taking weeks or months.
The difference between file encryption and sheet protection
Excel offers two separate protection methods, and they do different things. File encryption (what you just learned) locks the entire file so no one can open it without a password. Sheet protection allows someone to open the file but prevents them from editing specific sheets or cells.
Use file encryption when you want to hide the data completely — for example, a spreadsheet with salary information or financial records. Use sheet protection when you want people to view the data but not change it, or when you want to allow editing in some cells while locking others. You can use both methods on the same file if you need to.
Password protection in Excel Online and shared files
If you use Excel Online (the web version accessed through Microsoft 365), you cannot set a password directly in the online interface. Instead, read the file to your computer, password protect it in the desktop version of Excel, then upload it back to OneDrive or SharePoint. When someone opens it from the cloud, they will still be prompted for the password.
If you share a password-protected file with others, they will need the password to open it. There is no way to give someone access without sharing the password itself — Excel does not have a separate "share with password" feature. If you want to revoke access later, you must change the password and share the new one only with people who should still have it.
What to do if you forget your password
If you forget the password to an encrypted Excel file, the file is locked permanently. Microsoft cannot unlock it, and no official recovery method exists. Some third-party password recovery tools claim to break Excel encryption, but they are slow (often taking days or weeks), unreliable, and may not work on newer versions of Excel.
The best approach is to prevent this problem: store your password in a password manager, write it down and keep it in a safe place, or use a password you know you will remember. If you have a file you cannot open, your only practical option is to recreate the spreadsheet from a backup or from the original data source.
Frequently Asked Questions
Can I password protect just one sheet instead of the whole file?
Yes. Go to Review > Protect Sheet instead of using File > Info > Protect Workbook. This prevents editing on that sheet but allows the file to be opened without a password. People can still see the data; they just cannot change it.
Does password protection work if I email the file to someone?
Yes. The encryption stays with the file no matter how it is sent. When the recipient opens it, they will be asked for the password before they can see anything inside.
Can I change the password after I set it?
Yes. Open the file, go to File > Info > Protect Workbook > Encrypt with Password, and enter a new password. Save the file. The old password will no longer work.
Does password protection slow down the file or make it harder to use?
No. Once you enter the password and open the file, it works exactly the same as an unprotected file. The only difference is the password prompt when opening it.
What if I want to remove the password?
Open the file, go to File > Info > Protect Workbook > Encrypt with Password, leave the password field blank, and click OK. Save the file. The password protection is now removed.