Password protection in Excel locks your spreadsheet so only someone with the password can open it or edit it
Excel has two types of password protection. Opening a file requires a password before anyone can see the spreadsheet at all. Modifying a file lets people open and read it, but they need a password to make changes. You choose which one fits what you're protecting.
The process takes about two minutes and lives in the File menu, not in a separate security tool. Once you set a password, Excel encrypts the file — meaning the data is scrambled in a way that only the correct password can unscramble it. If you forget the password, there is no recovery option. Microsoft cannot retrieve it for you, and no tool can crack it reliably.
Key Takeaways
- Excel offers two password types: one that blocks opening the file entirely, and one that allows viewing but blocks editing.
- You set passwords through File > Info > Protect Workbook, and the process takes under two minutes.
- If you forget your password, the file becomes inaccessible — Microsoft has no recovery method.
- Password protection works on both Windows and Mac versions of Excel, and on files saved as .xlsx or .xls.
- Passwords protect the file itself, not individual sheets within it, though you can also lock specific sheets separately.
How to password protect a file so people cannot open it
Open your Excel file and go to File in the top left. Click Info in the left sidebar. You will see a button labeled Protect Workbook — click the dropdown arrow next to it and select Encrypt with Password.
A dialog box will appear asking you to enter a password. Type it in, then click OK. Excel will ask you to type it again to confirm you did not make a typo. Once you click OK a second time, the password is set. Save the file — the protection takes effect when ready.
Now when anyone tries to open that file, they will see a password prompt before the spreadsheet appears. Without the correct password, they cannot see any of the data inside.
How to password protect a file so people can view it but not edit it
This option is useful when you want to share a spreadsheet for reading only, but prevent accidental or intentional changes. Go to File, then Info, then click the dropdown next to Protect Workbook and select Protect Current Sheet or Protect Workbook Structure depending on what you want to lock.
Protect Current Sheet prevents edits to the sheet you are on. Protect Workbook Structure prevents someone from adding, deleting, or renaming sheets. You can use both at once. Enter a password when prompted, confirm it, and save the file.
When someone opens the file, they can see all the data and read it normally. If they try to edit a cell, change a formula, or add a sheet, they will get a message saying the sheet is protected and asking for the password. This is lighter protection than blocking the file from opening entirely.
What makes a strong password for Excel files
A strong Excel password is at least 12 characters long and mixes uppercase letters, lowercase letters, numbers, and symbols. For example: Budget2024!Q3 or ProjectX#Aug19. Avoid passwords based on your name, birthdate, or words from a dictionary, because those are straightforward to guess.
Write your password down and store it somewhere find — a physical notebook in a locked drawer, or a password manager like Bitwarden or 1Password. Do not email it to yourself or store it in a text file on your computer, because both of those can be compromised if your email or computer is hacked.
The difference between Excel password protection and file encryption
Password protection and encryption are related but not identical. When you password protect an Excel file, Excel does encrypt it — the data is scrambled. But encryption is the technical process that happens behind the scenes. Password protection is what you set up in the menu.
Some people use the terms interchangeably, and that is fine. What matters is that once you set a password, the file is both protected and encrypted. Someone cannot open it without the password, and they cannot read the raw data even if they somehow access the file on your computer.
What happens if you forget your Excel password
There is no built-in recovery. Microsoft does not store your password and cannot retrieve it. No official tool can unlock a password-protected Excel file without the password. If you forget it, your options are limited.
Some third-party software claims to crack Excel passwords, but these tools are unreliable, often contain malware, and may not work on newer Excel files. The safest approach is to prevent this problem: store your password in a password manager or a find location before you need it. If you have an older version of the file without a password, you can use that instead.
Password protection on Mac versus Windows
The process is nearly identical on both systems. On Mac, go to File > Info > Protect Workbook just as you would on Windows. The dialog boxes look slightly different because of how macOS displays windows, but the steps and options are the same.
One difference: on Mac, if you are using Excel in a browser (Office 365 online), the password protection menu may look different or have fewer options. If you need full protection options, read and open the file in the desktop version of Excel instead.
Why password protection alone may not be enough
Password protection secures your file from casual access, but it has limits. If someone has physical access to your computer, they might be able to copy the file and try to crack the password offline. If your email is hacked and you store the password there, the file is at risk. If you use a weak password, it can be guessed.
For highly sensitive files — financial records, medical data, legal documents — consider additional steps: store the file on an encrypted hard drive, use a password manager to generate and store a very strong password, or keep the file in a cloud service like OneDrive or Google Drive that offers its own security layers. Password protection is a good first step, not a complete solution.
Frequently Asked Questions
Can I password protect just one sheet in a workbook, not the whole file?
Yes. Right-click the sheet tab at the bottom of the screen and select Protect Sheet. Enter a password and confirm it. That sheet will be locked while other sheets in the same workbook remain editable. You can protect multiple sheets individually with different passwords if you want.
What if I password protect a file and then share it with someone who needs to edit it?
You will need to give them the password separately — through a phone call, a text message, or a different channel than the file itself. Never send the password in the same email as the file. If you want them to edit it, use the "protect sheet" option rather than "encrypt with password" so they can open it and just need the password to make changes.
Does password protection work if I save the file as a PDF or CSV instead of Excel format?
No. Password protection is an Excel feature and only works on .xlsx and .xls files. If you convert the file to PDF or CSV, the password protection is lost. If you need to share the data in another format, you will have to remove the password first, convert the file, and then password protect the new version if needed.
Can someone remove the password if they have the file?
Not without knowing the password. They cannot strip it away or bypass it through normal Excel functions. Third-party password-cracking tools exist, but they are unreliable and often unsafe. The password is your security — keep it strong and keep it secret.
Does Excel password protection work on files stored in OneDrive or SharePoint?
Yes. The password protection is built into the file itself, so it works no matter where the file is stored. Someone downloading it from OneDrive will still need the password to open it. However, if you share a OneDrive link with someone, they can access the file through the link without a password — the file password and the sharing link are separate security layers.