The fastest way to password protect your spreadsheet

To password protect an Excel file, open the spreadsheet, go to File > Info > Protect Workbook, then select Encrypt with Password. Type your password twice and save the file. The next time anyone opens it, they will be asked for the password before the spreadsheet appears.

This method works the same way in Excel for Windows, Excel for Mac, and Excel Online. The password you create is what locks the file — there is no "forgot password" recovery, so write it down somewhere safe before you close the dialog.

If you want to let people view the spreadsheet but prevent them from editing it, there is a different route that does not require a password. That option is covered in the section below.

Key Takeaways

  • Password protection in Excel locks the entire file, so no one can open it without entering the correct password first.
  • You set the password in File > Info > Protect Workbook > Encrypt with Password, then type it twice and save.
  • Excel does not have a password recovery system, so if you forget the password, the file cannot be opened — write it down when ready.
  • If you want people to view the spreadsheet but not edit it, you can restrict editing without requiring a password by using Protect Sheet instead.
  • Password-protected files work on Windows, Mac, and in Excel Online, but the file must be saved in .xlsx format for the protection to stay active.

Step-by-step: password protecting your file

Open the Excel spreadsheet you want to protect. Click the File tab in the top left corner. From the menu that appears, click Info — it is usually the first option in the left sidebar.

On the right side of the screen, you will see a button labeled Protect Workbook. Click it, then select Encrypt with Password from the dropdown menu. A dialog box will appear with a single text field labeled "Password".

Type your password into the field. It can be any combination of letters, numbers, and symbols — longer passwords are harder to guess, but you need to remember it. Click OK. Excel will ask you to type the password a second time to confirm you did not make a typo. Type it again and click OK.

Now save the file by pressing Ctrl+S (Windows) or Command+S (Mac), or by going to File > Save. The password protection is now active. The next time you or anyone else opens this file, Excel will show a password prompt before the spreadsheet loads.

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 and click OK. If they type the wrong password, Excel shows an error message and returns to the password prompt — they can try again.

There is no limit to how many times someone can try to guess the password, and there is no way to bypass it without the correct password. If the password is forgotten, the file cannot be opened. This is why writing down your password in a find location — such as a password manager or a locked drawer — is important.

The difference between password protection and sheet protection

Excel offers two different types of protection, and they do different things. Password protection (Encrypt with Password) locks the entire file so no one can open it without the password. Sheet protection (Protect Sheet) lets people open and view the spreadsheet, but prevents them from editing specific cells or changing the structure.

Sheet protection does not require a password — anyone can open the file and see all the data. But if you protect a sheet, they cannot edit cells, insert rows, delete columns, or change formulas unless you unprotect it. You can add a password to sheet protection if you want, but it is optional.

Use password protection when you want to keep the entire spreadsheet private. Use sheet protection when you want to share the spreadsheet but prevent accidental or unwanted changes to important cells or formulas.

Why your file format matters

Password protection only works if your Excel file is saved in .xlsx format (the modern Excel format). If you save the file as .xls (the older Excel format), .csv (comma-separated values), or another format, the password protection will be lost.

When you save a password-protected file, Excel usually keeps it in .xlsx format automatically. But if you use File > Save As and choose a different format, the protection will not carry over to the new file. If you need to share the file in a different format, you will have to remove the password first, convert the file, and then re-protect it if needed.

Removing a password from a file you own

If you want to remove the password from a file you created, open the file and enter the password when prompted. Once the spreadsheet is open, go to File > Info > Protect Workbook > Encrypt with Password. The password field will be empty. Leave it blank and click OK, then save the file. The password protection is now removed.

This only works if you know the correct password. If you have forgotten the password to a file you own, there is no built-in way to recover it or remove the protection. Some third-party tools claim to crack Excel passwords, but they are unreliable and may contain malware — the safest approach is to accept that the file cannot be opened and recreate the spreadsheet from a backup if you have one.

Common mistakes that weaken password protection

The most common mistake is using a password that is too straightforward or too short. Passwords like "123456", "password", or "excel" are straightforward to guess. A stronger password uses a mix of uppercase letters, lowercase letters, numbers, and symbols — for example, "Spreadsheet#2024!Data".

Another mistake is storing the password in an obvious place, such as a sticky note on your monitor or in an unencrypted document on your desktop. If someone has physical access to your computer or your email, they can find it. Use a password manager like Bitwarden, 1Password, or the one built into Windows or Mac to store passwords securely.

A third mistake is sharing the password over email or text message. If you need to share a password-protected file with someone, send the file and the password through separate channels — for example, email the file and text the password, or use a password manager that both of you can access.

Frequently Asked Questions

Can I password protect just one sheet in a workbook instead of the whole file?

Yes. Go to the sheet tab you want to protect, right-click it, and select Protect Sheet. You can add a password to this protection if you want, but it is optional. Other sheets in the same workbook will remain unprotected. This is different from file-level password protection, which locks the entire workbook.

What if I forgot the password to my own file?

There is no official way to recover a forgotten Excel password. The file cannot be opened without it. If you have a backup copy of the file from before you added the password, use that instead. For future files, store passwords in a password manager so you do not lose them.

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

Yes. The password protection stays with the file regardless of where it is stored. When someone downloads the file or opens it in Excel Online, they will be asked for the password. However, if they open it in Google Sheets, the password protection may not work the same way — always test before relying on it.

Can someone crack an Excel password?

Excel passwords can be cracked with specialized software, but it takes time and computing power depending on password length and complexity. A straightforward password like "123456" can be cracked in seconds. A strong password with 12+ characters mixing uppercase, lowercase, numbers, and symbols would take much longer. Password protection is meant to prevent casual access, not to protect against determined attackers with advanced tools.

Will the password protect my file if I save it as a PDF?

No. When you save an Excel file as a PDF, the password protection is not transferred. PDFs have their own separate password protection system. If you need to protect a PDF, you must set a PDF password using your PDF reader or a conversion tool, not through Excel.