Yes, you can password-protect an Excel file so that anyone opening it must enter a password. You can also set a separate password to prevent others from editing the file. The steps below work in Excel 2016 and later, including Microsoft 365. Menu names may differ slightly by version, but the general paths are the same.

What You'll Need

  • Microsoft Excel (desktop version; steps differ slightly in Excel for the web)
  • The Excel file you want to protect
  • A password you can remember (or a password manager to store it)

Step-by-Step

Password to Open the File

  1. Open the Excel file you want to protect.
  2. Click on File in the top-left corner.
  3. In the menu that appears, click Info (if not already selected).
  4. Click Protect Workbook (or Protect Document on some versions). A dropdown menu will appear.
  5. Select Encrypt with Password.
  6. In the dialog box, type a password. Note: Excel does not show the password as you type it, and there is no way to recover it if you forget it. Make sure you type it correctly.
  7. Click OK.
  8. Excel will ask you to re-enter the password to confirm. Type it again and click OK.
  9. Click Save (or press Ctrl+S) to save the file with the password applied.

Now, whenever anyone tries to open the file, Excel will prompt them for the password. Without it, they cannot view the contents.

Password to Prevent Editing (Read-Only)

If you want others to be able to open the file but not make changes without a password, follow these steps:

  1. Go to File > Save As.
  2. Choose where to save the file (e.g., This PC, OneDrive).
  3. In the Save As dialog, click Tools (next to the Save button) and select General Options.
  4. Under File sharing, you will see two fields: Password to open and Password to modify.
  5. Type a password in the Password to modify field (or both fields if you want both protections).
  6. Click OK, then confirm the password(s) when prompted.
  7. Click Save. If the file already exists, Excel will ask if you want to replace it—click Yes.

Now, when someone opens the file, they can click Read Only to view it without a password, or enter the modify password to edit and save changes.

Common Mistakes

  • Forgetting the password: Excel does not offer a built-in password recovery. If you forget it, you cannot open the file. Always store passwords in a secure password manager.
  • Not saving after applying the password: If you close the file without saving, the password is not applied. Always press Ctrl+S after setting it.
  • Using the same password for open and modify: If you set the same password for both, users will only be prompted once. To have separate prompts, use different passwords.
  • Sharing the file before saving: If you send the file via email or cloud before saving, the recipient gets an unprotected version.

Tips

  • Use a strong password with a mix of uppercase, lowercase, numbers, and symbols. The longer, the better.
  • If you only need to prevent accidental edits (not secure protection), you can use Mark as Final under Protect Workbook—but this is not a real password and can be easily removed.
  • For sensitive data, consider also encrypting the file with a tool like BitLocker (Windows) or FileVault (Mac) for an extra layer of security.
  • Excel for the web does not support password protection. You must use the desktop version to set or remove passwords.

Troubleshooting

I forgot the password

Unfortunately, there is no official way to recover a lost Excel password. If you have not saved the password anywhere, you may need to use a third-party recovery tool, but these are not guaranteed and can be risky. The best practice is to always store passwords in a password manager.

The password prompt does not appear when opening the file

  • Make sure you saved the file after applying the password.
  • Check that you are opening the correct file—maybe you have an older copy without the password.
  • If you are using Excel for the web, password protection is not supported; open the file in the desktop app.

I set a modify password, but I can still edit without it

If you open the file and click Read Only, you can edit the file in memory, but you will not be able to save changes to the original file. To save changes, you must enter the modify password. If you want to completely prevent editing, you need to use the Encrypt with Password method (password to open) instead.

The password is not working on another computer

Make sure you are using the exact same password, including case sensitivity. Also, ensure the file was saved after setting the password. If the file was saved in an older format (.xls), the encryption is weaker and may not work on newer versions—save as .xlsx for best compatibility.

Frequently Asked Questions

Can I password protect a single sheet in Excel?

Yes, you can protect a specific worksheet by going to Review > Protect Sheet, then setting a password. This prevents users from editing that sheet, but they can still open the file and view the sheet. It is separate from file-level password protection.

Can I remove a password from an Excel file?

Yes, if you know the password. Open the file, go to File > Info > Protect Workbook > Encrypt with Password, delete the password from the field, click OK, and save the file. For a modify password, use Save As > Tools > General Options and clear the password fields.

Is Excel password protection secure?

Excel's encryption is generally secure for most purposes, especially in newer versions (2016 and later) which use AES-256 encryption. However, it is not unbreakable—determined attackers with specialized tools might crack weak passwords. Use a strong password to maximize security.

Does password protection work on Excel for Mac?

Yes, the steps are similar. In Excel for Mac, go to File > Passwords to set a password to open or modify. The menus may look slightly different, but the functionality is the same.

Can I password protect an Excel file on Google Sheets?

No, Google Sheets does not have a built-in password protection feature. You can restrict sharing permissions, but that is not the same as a password. To password protect, you would need to download the file as an Excel file and apply the password in Excel.

What happens if I forget the modify password?

You can still open the file in read-only mode and view the contents, but you cannot save changes without the modify password. There is no official way to recover it, so keep a backup of the password somewhere safe.