Can You Password Protect an Excel File? How It Works

How-to basics · Updated November 21, 2026

Yes. In Excel for Microsoft 365 on Windows, open the workbook and select File > Info > Protect Workbook > Encrypt with Password, enter a strong password, and save the file. That encrypts the workbook so it requires the password to open; worksheet and workbook-structure protection are different features and do not provide the same privacy.

What Excel password protection actually does

The phrase “password protect an Excel file” can mean several things. The most important distinction is whether you want to stop someone from opening the file or simply limit changes after it has been opened. Excel offers settings for both, but only file encryption is intended to keep the workbook’s contents confidential from people who do not have the password.

When you encrypt a workbook with a password to open it, Excel requires that password before displaying the file. Someone who does not know it should not be able to open the workbook’s contents in Excel. This is useful for sensitive spreadsheets stored on a shared computer, attached to an email, or kept in a location that other people can access.

By contrast, protecting a worksheet can discourage edits to selected cells, and protecting workbook structure can prevent changes such as adding, deleting, or moving sheets. Those controls are intended to manage editing, not to hide information. They should not be treated as a substitute for encryption or secure file storage.

How to encrypt a workbook on Windows

In the Microsoft 365 desktop app for Windows, use the following steps to set a password that is required to open the workbook:

  1. Open the workbook you want to protect.
  2. Select File, then Info.
  3. Select Protect Workbook, then Encrypt with Password.
  4. Enter a password, select OK, and enter it again when prompted to confirm.
  5. Save the workbook. Close it and reopen it to check that Excel asks for the password.

The password takes effect when the workbook is saved. Keep a separate, secure record of it before closing the file: if you forget it, Microsoft generally cannot retrieve or reset it for you. A password prompt on reopening is a useful check that you applied the setting you intended.

Use a password that is difficult to guess and not reused for another account or file. A longer passphrase made from several unrelated words can be easier to remember than a short string of mixed characters, while still being difficult to guess. A password manager is a practical place to store it and share it with authorized collaborators when necessary.

Open passwords, sheet protection, and structure protection

Excel’s protection options have different purposes. Choose the one that matches the risk you are trying to address:

  • Password to open: Encrypts the workbook and asks for a password before it can be opened. Use this when the goal is to restrict access to the workbook’s contents.
  • Protect Sheet: Restricts certain actions on a worksheet, such as editing locked cells. On Windows, find it on the Review tab. You can leave particular cells unlocked before protecting the sheet so users can enter information in designated places.
  • Protect Workbook: The Review tab’s workbook-protection option can protect the workbook’s structure, such as preventing sheets from being added, deleted, moved, hidden, or renamed. This is not the same as encrypting the file.

For example, a team might encrypt a spreadsheet containing confidential customer details and also protect a worksheet so users can edit only the input cells. The first setting addresses access to the file; the second helps preserve the worksheet’s layout. If someone can open an unencrypted workbook, sheet protection should not be assumed to keep its data secret.

What worksheet protection does—and does not—secure

Worksheet protection is useful for reducing accidental changes. A template author can lock formulas and headings while unlocking cells intended for data entry, then protect the sheet. This can prevent a colleague from overwriting a formula while filling in a form. Workbook-structure protection can similarly prevent unintentional changes to the arrangement of sheets.

These protections are not designed as strong security barriers. They do not encrypt the workbook’s contents, and they should not be relied on to stop a determined person from accessing data or altering a file. If you need to keep confidential information from a recipient, do not send it in an unencrypted workbook and assume that hiding a sheet or protecting it will conceal the information. Use file encryption and carefully control who receives the password.

Also consider what the recipient needs to do. If they need to enter information, protect formulas and layout selectively rather than locking every cell. If they must not see certain records, remove those records from the copy you share; hiding rows or sheets is not a reliable way to conceal them.

Choosing the right protection for your situation

Start with the outcome you need, rather than with the word “password.” For privacy, set an open password through Encrypt with Password. For preventing accidental edits, use sheet protection and configure the unlocked cells and allowed actions. For preserving the sheet tabs and their arrangement, protect the workbook structure. You can combine these options when they serve separate purposes.

Think about how the file will be shared and stored as well. An encrypted attachment can still be forwarded, and a password sent in the same email as the attachment may offer little practical separation. A safer approach is to share the password through a different channel, such as a phone call or a separate trusted messaging method. For a team that needs ongoing access, a managed storage location with individual permissions may be easier to administer than passing around a shared password.

Be especially cautious with workbooks that contain personal, financial, health, or business-sensitive information. Check whether your organization has rules for encryption, approved storage, and external sharing. A password on a file does not replace those requirements, and it does not prevent an authorized recipient from copying or photographing information after opening it.

Changing or removing an open password

If you know the current password and want to change it, open the workbook with that password and return to File > Info > Protect Workbook > Encrypt with Password. Replace the existing entry with the new password, confirm it, and save. Close and reopen the file to verify the new password works.

To remove the password in Windows, open the workbook, go to the same Encrypt with Password dialog, delete the password so the field is blank, confirm the change, and save the file. The workbook will no longer require that password to open. Make sure you are allowed to remove the protection, especially if the file belongs to an employer or another person.

Changing or removing sheet protection is separate from changing the open password. You will need the relevant sheet or structure password to unprotect it when one was set. Removing one type of protection does not automatically remove the others.

Mac and Excel for the web differences

In Excel for Microsoft 365 on Mac, password options are available in the desktop app, but the route is not identical to the Windows Info page. Depending on the Mac app version, use File > Passwords to set or change a password for opening or modifying the workbook. Review-tab options are used for worksheet or workbook protection. Menu labels can vary between releases, so check the current Excel for Mac interface if a command is not in the same place.

Excel for the web does not provide the same desktop workflow for adding, changing, or removing workbook encryption passwords. A workbook encrypted with an open password may need to be opened in the Excel desktop app rather than the browser. If you are collaborating in a browser, use the sharing and access controls for the cloud location, and confirm that collaborators can open the file in the app they plan to use.

Compatibility can matter when a file moves between Excel versions or other spreadsheet programs. If a recipient cannot open an encrypted workbook, confirm that they have an Excel desktop version that supports the file and encryption settings. Do not remove encryption just to make sharing easier unless the information is appropriate to share without it.

Common problems and recovery risks

The most serious problem is losing the open password. Microsoft does not provide a universal password-recovery service for an encrypted workbook, and there may be no practical way to recover the original contents without the correct password. Before encrypting an important file, confirm that the password is stored securely and that an authorized person can retrieve it if you are unavailable.

  • The password prompt does not appear: Check that you chose Encrypt with Password, not Protect Sheet or workbook-structure protection, and that you saved the workbook after setting it.
  • A recipient cannot open the file: Check that they have the right password, are opening the correct copy, and are using a compatible desktop version of Excel.
  • You can open the file but cannot edit a cell: The worksheet may be protected. This is a separate issue from the password required to open the workbook.
  • You forgot the password: Look in your password manager, approved organizational records, or an earlier secure handoff. Avoid uploading sensitive files to untrusted “password recovery” sites.

Keep a secure backup before making major protection changes, and be careful about creating multiple copies with different passwords. Clear naming and a controlled password record can prevent confusion over which version is current.

Frequently Asked Questions

Can I password protect just one Excel sheet?
Yes. Select the worksheet and use Review > Protect Sheet to restrict editing actions. This helps prevent accidental changes, but it does not encrypt the sheet or keep its information confidential from someone who can open the workbook.

Can someone open an Excel file without the password if the sheet is protected?
Yes. Sheet protection is different from an open password. A person may be able to open the workbook and view its contents even when editing on a protected sheet is restricted.

Can I remove an Excel password if I know it?
Yes. Open the workbook, use File > Info > Protect Workbook > Encrypt with Password on Windows, clear the password, and save. On Mac, use the password options available from the File menu.

What happens if I forget the password to open the workbook?
You may be unable to open the encrypted file, and Microsoft generally cannot recover the password for you. Check your password manager or secure records before assuming the file is lost.

Can I password protect an Excel file in a browser?
Excel for the web does not offer the same controls for setting or removing an open password as the desktop app. Use Excel for Microsoft 365 on Windows or Mac to manage workbook passwords, and use cloud-sharing permissions to control who can access a browser-based copy.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.