The fastest way to password-protect an Excel file

Open the file in Excel, then go to File > Info > Protect Workbook > Encrypt with Password. Type your password twice and click OK. Save the file. Anyone who opens it will need that password to view or edit it.

This method encrypts the entire file, so the password is required before anyone can see any content. It takes about 30 seconds and works on both Windows and Mac versions of Excel.

Key Takeaways

  • Excel's built-in encryption requires a password to open the file at all — the person cannot see any data without entering it correctly.
  • The password you set is not recoverable if you forget it, so write it down somewhere safe before you close the file for the first time.
  • You can also restrict editing without requiring a password to open, which lets people view the file but prevents changes unless they know a second password.
  • Password protection works the same way on Windows and Mac, though the menu path is identical in both versions of Excel.

Step-by-step: password to open the file

Start with the file open in Excel. Click the File tab at the top left. In the left sidebar, click Info. On the right side of the screen, you will see a button labeled Protect Workbook with a dropdown arrow next to it. Click that arrow.

A small menu appears. Click Encrypt with Password. A dialog box opens asking you to enter a password. Type your password in the first field. Type it again in the second field to confirm you typed it correctly. Click OK. Excel closes the file and asks you to save it. Click Save. The password is now active.

The next time anyone opens this file, Excel will prompt them for the password before the spreadsheet appears. If they enter the wrong password, the file will not open.

Restrict editing without requiring a password to open

If you want people to view your spreadsheet but prevent them from making changes, you can set a password for editing only. Go to File > Info > Protect Workbook > Protect Current Sheet (or Protect Workbook Structure if you want to lock the sheet tabs themselves).

A dialog box opens. Leave the first field blank if you want people to open the file without a password. Enter a password in the second field labeled Password to modify. Click OK, confirm the password, and save. Now anyone can open the file, but they cannot edit it unless they know the password. If they try to edit, Excel will ask for the password.

This approach is useful when you want to share a file for review but prevent accidental changes. The person viewing it can still copy data out, so this is not a security measure — it is a safeguard against mistakes.

What happens if you forget the password

Excel does not have a built-in password recovery tool. If you forget the password you set, you cannot open the file. There is no "forgot password" button, no recovery email, and no way to contact Excel support to unlock it.

Some third-party password recovery tools claim to crack Excel passwords, but they work only on older Excel files (before 2007) or require significant time and computing power for newer files. For practical purposes, a forgotten password means the file is inaccessible. Write down your password and store it somewhere find — a password manager, a locked drawer, or a trusted person who knows where to find it.

Password protection on Mac

The process is identical on Mac. Open the file, click File > Info > Protect Workbook > Encrypt with Password. Enter your password twice and click OK. Save the file. Mac users will see the same password prompt when opening the file as Windows users do.

One difference: on Mac, the Info option appears in the File menu itself rather than in a sidebar. The rest of the steps are the same.

Removing a password from a file

If you want to remove password protection from a file you already encrypted, open it with the password. Go to File > Info > Protect Workbook > Encrypt with Password. The password field will be empty. Leave it empty and click OK. Save the file. The password protection is now removed.

Anyone can now open the file without entering anything. If you set a password for editing only (not opening), you remove it the same way: go to Protect Current Sheet or Protect Workbook Structure, leave the password fields blank, and click OK.

Frequently Asked Questions

Can I password-protect just one sheet instead of the whole file?

Yes. Go to File > Info > Protect Workbook > Protect Current Sheet. This locks only the sheet you are on, so other sheets in the same file remain editable. The person can still see the sheet tabs and switch between sheets, but they cannot change data on the protected sheet without the password.

What if I want to let people edit some cells but not others?

First, select the cells you want people to be able to edit. Right-click and choose Format Cells > Protection tab, then uncheck Locked. Then protect the sheet with Protect Current Sheet. Now only the unlocked cells can be edited; the rest are locked. People can still view locked cells, but they cannot change them.

Does password protection work if I save the file as a PDF?

No. If you save an Excel file as a PDF, the Excel password protection does not transfer. You would need to set a PDF password separately using your PDF reader or a PDF tool. The two formats use different encryption methods.

Can someone remove the password if they have the file?

Not without knowing the password. Excel's encryption is strong enough that brute-force cracking is impractical for most users. However, if someone has physical access to your computer or your cloud storage, they could potentially access the file before you password-protect it, so physical security matters too.