Password protection locks your Excel file so only people with the password can open it

You can add a password to an Excel file in a few minutes using the built-in protection feature. When someone tries to open the file without the password, Excel will ask for it before showing any data. 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 idea is the same: you go to File, find the protection option, and set a password. Once you do this, the file itself stays encrypted — even if someone copies it to another computer, they still cannot open it without the password.

Key Takeaways

  • Password protection in Excel encrypts the entire file so it cannot be opened without the correct password.
  • On Windows and Mac, you use File > Info > Protect Workbook to set an opening password.
  • On Excel online, you access protection through File > Info > Protect Workbook as well.
  • Write down your password somewhere safe — Excel cannot recover a forgotten password, and you will lose access to the file.
  • Password protection is different from sheet protection, which only locks individual sheets but lets people open the file.

How to password protect Excel on Windows

Open the Excel file you want to protect. Click the File tab in the top left corner, then look for Info in the left menu and click it. You will see a button that says Protect Workbook — click the dropdown arrow next to it.

Select Encrypt with Password from the menu. A dialog box will appear asking you to enter a password. Type the password you want to use, then click OK. Excel will ask you to type the password again to confirm it — this prevents typos from locking you out. Click OK again, then save the file. The next time anyone opens it, they will see a password prompt.

How to password protect Excel on Mac

Open your Excel file and click File at the top of the screen. Select Info from the menu. Look for the Protect Workbook button and click the dropdown next to it.

Choose Encrypt with Password. Type your password in the box that appears, then click OK. Excel will ask you to enter it again to confirm. Click OK one more time, then save the file using File > Save or Command+S. The password protection takes effect immediately.

How to password protect Excel online

If you use Excel through Microsoft 365 online, open your file in the browser. Click File in the top left, then select Info. You will see Protect Workbook — click the dropdown arrow next to it.

Select Encrypt with Password. Enter your password and click OK, then enter it again to confirm. The file saves automatically in OneDrive, so the protection is active right away. Anyone who tries to open the file will need the password first.

What to do if you forget your password

Excel does not have a built-in way to recover a forgotten password. Once you set one, there is no "forgot password" option — Microsoft cannot reset it for you, and no tool can unlock the file without it. This means if you forget the password, you lose access to that file permanently.

Before you set a password, write it down and store it somewhere safe — a password manager, a locked drawer, or a secure note app. If you are protecting a file that other people need access to, tell them the password through a separate channel (like a phone call or a different email) rather than in the same message as the file itself.

The difference between file protection and sheet protection

File protection (what we covered above) locks the entire Excel file. Nobody can open it or see any data without the password. Sheet protection is different — it locks individual sheets within a file but lets people open the file itself. Sheet protection is useful when you want people to see certain sheets but not edit them, or when you want to prevent accidental changes to formulas.

If you only want to prevent editing on specific sheets, use sheet protection instead. Right-click the sheet tab at the bottom, select Protect Sheet, and set a password. People can still open the file and view the sheet, but they cannot change anything on that sheet without the password. For total secrecy, use file protection.

Why password protection matters and what it does not do

Password protection encrypts your file, which means the data inside is scrambled until someone enters the correct password. This stops casual access and protects against someone quickly opening your file to peek at the contents. It also prevents accidental sharing — if you email the file, only the person with the password can open it.

Password protection does not hide the file itself or prevent someone from deleting it. It also does not protect against someone with advanced technical skills who has time and resources to crack the password. For most everyday situations — protecting sensitive spreadsheets from coworkers, keeping financial data private, or securing a file before sending it — password protection is enough.

Frequently Asked Questions

Can I change the password after I set it?

Yes. Open the file with the current password, go to File > Info > Protect Workbook > Encrypt with Password, and enter a new password. You do not need to enter the old password first — just type the new one and confirm it. Save the file when you are done.

What happens if someone tries to open the file without the password?

Excel will show a password prompt before the file opens. They cannot see any data or even the filename contents without entering the correct password. If they enter the wrong password, they can try again or cancel and close the file.

Does password protection work if I share the file through OneDrive or Google Drive?

Yes. The password protection is built into the file itself, not the cloud service. Even if you share the file link with someone, they still need the password to open it. The cloud service does not remove the protection.

Can I remove the password protection later?

Yes, but you need the original password. Open the file, go to File > Info > Protect Workbook > Encrypt with Password, and leave the password field blank. Click OK, and the protection is removed. Save the file to complete the change.

Is password protection the same as making a file read-only?

No. Read-only means people can open and view the file but cannot save changes to it. Password protection means they cannot open the file at all without the password. They are two different features that serve different purposes.