Password protection in Excel works by encrypting your file so it cannot open without the correct password
When you password-protect an Excel file, Windows or Mac encrypts the entire document. Anyone who tries to open it sees a password prompt before they can view, edit, or print anything inside. The protection stays in place until someone enters the correct password — there is no back door or recovery method if you forget it, so write your password down somewhere safe.
Excel offers two types of protection. File-level protection locks the entire workbook and requires a password to open it at all. Sheet-level protection locks individual sheets within a workbook, allowing the file to open but preventing changes to specific sheets. Most people need file-level protection when they want to keep sensitive data private.
Key Takeaways
- File-level protection encrypts your entire Excel file and requires a password before anyone can open it.
- You set a password through File > Info > Protect Workbook on Windows, or File > Properties on Mac.
- Write down your password and store it separately from the file, because Excel cannot recover a forgotten password.
- Sheet-level protection prevents editing on specific sheets but allows the file to open without a password.
- Password protection works the same way in Excel 2016, 2019, 2021, and Microsoft 365 on both Windows and Mac.
How to password protect an Excel file on Windows
Open the Excel file you want to protect. Click the File tab in the top left corner, then select Info from the left menu. You will see a button labeled Protect Workbook with a dropdown arrow next to it.
Click the dropdown arrow next to Protect Workbook and select Encrypt with Password. A dialog box will appear asking you to enter a password. Type your password in the field — it will show as dots for security. 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 encrypted. Close and reopen the file to verify the password prompt appears.
How to password protect an Excel file on Mac
Open the Excel file you want to protect. Click File in the menu bar at the top, then select Properties from the dropdown. A panel will open on the right side of your screen.
In the Properties panel, look for the section labeled Protection. Click the checkbox next to Encrypt with password. A dialog box will appear asking you to create a password. Type your password and click OK.
Mac will ask you to enter the password again to confirm. Type it a second time and click OK. Save the file — use Command + S or go to File > Save. The next time you or anyone else opens this file, they will see a password prompt.
What happens when someone tries to open a password-protected file
When a password-protected Excel file is opened, a dialog box appears when ready asking for the password. The person opening the file must type the correct password to proceed. If they enter the wrong password, Excel displays an error message and returns them to the password prompt. They can try again, but there is no limit to attempts — this means a determined person could theoretically try many passwords.
If the correct password is entered, the file opens normally and the person can view, edit, and print the contents. The password does not need to be entered again during that session unless the file is closed and reopened.
How to remove password protection from an Excel file
Open the password-protected file and enter the password when prompted. Once the file is open, follow the same steps you used to add the password. On Windows, go to File > Info > Protect Workbook > Encrypt with Password. On Mac, go to File > Properties > Protection > Encrypt with password.
This time, leave the password field blank and click OK. When prompted to confirm, leave the field blank again and click OK. Save the file. The password protection is now removed, and the file will open without a password prompt.
Sheet-level protection as an alternative to file-level protection
If you want people to open your Excel file but prevent them from editing certain sheets, use sheet-level protection instead. This locks specific sheets while leaving others editable. Go to the sheet you want to protect, then click Review (or Sheet on Mac) in the menu bar. Select Protect Sheet.
A dialog box will appear. You can enter a password here, but it is optional — you can protect a sheet without a password, which straightforward prevents accidental changes. If you add a password, anyone who tries to unprotect the sheet later will need to enter it. Click OK to explore the protection.
Sheet protection does not encrypt your file the way file-level protection does. Someone with technical knowledge could potentially work around sheet protection, so use it for preventing accidental edits rather than keeping data truly private.
Important things to remember about Excel passwords
Excel passwords are case-sensitive, meaning "Password123" is different from "password123". Write down your password exactly as you typed it, including capital letters and special characters. Store this written copy somewhere find and separate from the file itself — in a locked drawer, a password manager, or another safe location.
If you forget your password, Excel cannot recover it and there is no way to open the file without it. You will lose access to the file permanently. For this reason, many people store important password-protected files in two places: one encrypted copy and one unencrypted backup stored separately, in case they forget the password.
Password protection in Excel is not military-grade encryption. It is sufficient to prevent casual access and accidental changes, but someone with specialized tools and time could potentially break the encryption on older Excel files. If you are protecting highly sensitive financial or personal data, consider additional security measures like storing the file on an encrypted drive or using a dedicated password manager.
Frequently Asked Questions
Can I password protect just one sheet in an Excel workbook?
Yes. Go to the sheet you want to protect, click Review (or Sheet on Mac), then select Protect Sheet. You can add a password or leave it blank. Other sheets in the same workbook will remain unprotected and editable.
What if I forget the password to my Excel file?
Excel does not have a password recovery option. If you forget the password, you cannot open the file. This is why you should write down your password and store it separately from the file. If you lose access, your only option is to use an unencrypted backup copy if you have one.
Does password protecting an Excel file slow it down?
No. Password protection does not affect how fast the file opens or how it performs once it is open. The only difference you will notice is the password prompt when you first open the file.
Can I change my password after I have already protected the file?
Yes. Open the file with the current password, then go to File > Info > Protect Workbook > Encrypt with Password (Windows) or File > Properties > Protection > Encrypt with password (Mac). Enter your new password and confirm it. Save the file.
Will password protection work if I share the file via email or cloud storage?
Yes. The password protection stays with the file no matter how it is shared. When someone downloads or opens the file from email, OneDrive, Google Drive, or any other location, they will see the password prompt before they can access it.