Password protection locks your Excel file so that anyone who tries to open it must type the correct password first
Excel has a built-in password feature that encrypts your file. When you set a password, the file becomes unreadable without it — even if someone copies the file to their computer, they cannot open it without entering the password you chose. This works the same way in Excel on Windows, Mac, and the web version.
The steps differ slightly depending on which version you use, but the result is the same: your spreadsheet stays locked until someone enters the password. This guide covers the most common versions — Excel on Windows, Excel on Mac, and Excel Online.
Key Takeaways
- Password protection in Excel encrypts the file so it cannot be opened without the correct password.
- On Windows, use File > Info > Protect Workbook > Encrypt with Password to set a password.
- On Mac, use File > Properties > Security > Encrypt File Contents to password-protect your spreadsheet.
- Excel Online does not have a native password feature, but you can password-protect the file through your OneDrive or SharePoint settings instead.
- Write down your password somewhere safe — Excel cannot recover it if you forget it.
Password-protecting Excel 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 sidebar. You will see a button labeled Protect Workbook with a dropdown arrow next to it.
Click that dropdown arrow 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. Excel will not show you what you are typing, so type carefully. Click OK.
Excel will ask you to enter the password a second time to confirm it. Type the same password again and click OK. The file is now password-protected. The next time anyone opens this file, they will see a password prompt before the spreadsheet appears.
Password-protecting Excel on Mac
Open the Excel file you want to protect. Click File in the menu bar at the top of the screen, then select Properties from the dropdown. A new window will open.
Look for the Security section in the Properties window. You will see a checkbox labeled Encrypt File Contents. Click that checkbox. A password dialog will appear. Enter the password you want to use and click OK.
Mac will ask you to confirm the password by typing it again. Enter it a second time and click OK. Save the file by pressing Command+S or using File > Save. Your file is now password-protected.
Password-protecting Excel Online
Excel Online (the version you use in your web browser through Microsoft 365) does not have a password feature built into the application itself. Instead, you protect the file through the storage service it uses — either OneDrive or SharePoint.
If your file is stored in OneDrive, right-click the file name in OneDrive and select Share. Change the sharing settings to Specific People and remove anyone you do not want to have access. This restricts who can open the file, but it does not password-protect the file itself. For true password protection, download the file to your computer, password-protect it using the Windows or Mac steps above, then upload it back to OneDrive.
What to do if you forget your password
Excel cannot recover a forgotten password. Microsoft does not store your password and has no way to unlock the file for you. If you forget the password, the file remains locked and unreadable.
The only way to regain access is to use a third-party password recovery tool, which may or may not work depending on the password strength and Excel version. These tools are not made by Microsoft and their success rate varies. Your best protection is to store your password in a password manager like Bitwarden, 1Password, or the password manager built into your web browser.
Choosing a strong password for your Excel file
A strong password is harder for someone to guess or crack. Use at least 12 characters and mix uppercase letters, lowercase letters, numbers, and symbols. For example: BlueSky#2024Jazz is stronger than password123.
Avoid using information that is easy to guess, like your birthday, your name, or common words. Do not use the same password for multiple files or accounts. If someone learns that password, they can access everything you protected with it.
Removing password protection from an Excel file
Open the password-protected file and enter the password when prompted. Click File and select Info (on Windows) or Properties (on Mac). Find the Protect Workbook or Encrypt File Contents option and click it. You will be asked to enter the password again to confirm you want to remove the protection. Enter it and click OK. Save the file. The password protection is now removed.
If you remove the password protection, the file will open without a password prompt the next time you or anyone else opens it. Make sure you actually want to remove the protection before you complete this step, because once it is gone, anyone with access to the file can open it.
Frequently Asked Questions
Can someone crack an Excel password?
Yes, but it depends on password strength and the Excel version. Older Excel versions (before 2007) are easier to crack. Newer versions use stronger encryption. A short, simple password can be cracked faster than a long, complex one. Using a strong password with 12+ characters, numbers, and symbols makes cracking much harder.
Does password-protecting an Excel file slow it down?
No. The file opens and runs at the same speed. The only difference is that you see a password prompt before the file opens. Once you enter the password, the file behaves normally.
Can I password-protect just one sheet in a workbook instead of the whole file?
Yes, but it works differently. Use the Review tab and select Protect Sheet to lock a single sheet. This prevents others from editing that sheet, but they can still open the file. To prevent anyone from opening the file at all, you need to password-protect the entire workbook using the steps above.
What happens if I password-protect a file and then share it with someone?
They will see a password prompt when they try to open it. You must give them the password separately — through email, text, or in person. Never include the password in the same message or file as the spreadsheet itself.
Does Excel save my password anywhere?
No. Excel does not store your password. It only stores an encrypted version of it. This means Excel cannot show you the password if you forget it, but it also means no one can see your password by looking at the file's properties or settings.