Password Protect an Excel Spreadsheet: Steps and Safety

How-to basics · Updated November 20, 2026

Yes. In Excel for Microsoft 365 on Windows, open the workbook and choose File > Info > Protect Workbook > Encrypt with Password, enter and confirm a password, then save. This encrypts the file, so the password is required to open it.

What a password-protected Excel file does

Encrypting a workbook with a password is the option to use when you want to stop someone who obtains the file from opening and reading it. Excel requires the password before showing the workbook’s contents. This differs from putting a password on a worksheet or protecting the workbook’s structure: those controls restrict certain actions after a person has opened the file, but they are not a substitute for encrypting confidential data.

Encryption is useful when a workbook contains information such as employee details, customer records, internal budgets, or other data that should not be visible to anyone who finds a copy. It can protect a saved file on a computer or an attachment sent to another person. It does not decide who is allowed to download the file from OneDrive or SharePoint; access to the location is managed separately by its sharing permissions.

A password also does not protect information after an authorized person has opened the workbook. That person can read, copy, photograph, or share its contents, depending on their access and the circumstances. Think of file encryption as a barrier to opening the saved document, not as a complete information-security system.

How to encrypt a workbook in Excel for Windows

Use the desktop version of Excel for Microsoft 365 on Windows. The menu path is File > Info > Protect Workbook > Encrypt with Password. Follow these steps:

  1. Open the workbook you want to protect. If it is already shared, consider whether other users need to know about the new password before you change its access requirements.
  2. Select File, then Info. Open Protect Workbook and choose Encrypt with Password.
  3. Enter a password in the dialog box and select OK. Excel asks you to enter it again to confirm.
  4. Save the workbook. Close it and reopen it to verify that Excel asks for the password and that the password works.

Excel passwords are case-sensitive, so uppercase and lowercase letters matter. A password that differs by one character will not work. If Excel is already open with the file, the workbook may remain accessible until you close it; the password prompt appears when you next open the saved, encrypted file.

Use a current Excel workbook format such as .xlsx or .xlsm where appropriate. If you must share the file with people using older spreadsheet software, check that their program supports the encrypted format before relying on the password. A recipient who cannot open the file may need a compatible desktop application rather than a different password.

Choose the right kind of protection

Excel offers several controls called protection, and choosing the wrong one is a common source of confusion. Decide what you need to prevent:

  • Require a password to open: Use Encrypt with Password when the workbook’s contents should not be visible without authorization.
  • Restrict changes to a worksheet: Use Review > Protect Sheet to limit editing of cells or worksheet features. This is useful for preventing accidental edits to formulas or a form layout, not for hiding confidential data.
  • Restrict changes to workbook structure: Use Review > Protect Workbook to limit structural actions such as adding, deleting, moving, or hiding sheets. It does not encrypt the cells or prevent someone from reading them.

For example, suppose a sales workbook contains a confidential customer list and a formula-driven summary. Encrypt the file if the list must not be read by an unauthorized person. You might also protect the summary sheet to reduce accidental changes to formulas. The second control is helpful for editing discipline, but only the file-opening password addresses confidentiality at rest.

Worksheet and structure protection are often described casually as locking a spreadsheet. That wording can make them sound stronger than they are. They are mainly controls over editing, while encryption is the relevant option for restricting access to the saved contents.

Excel for Mac and Excel for the web

In Excel for Mac, the password settings are reached through File > Passwords. Use the option for requiring a password to open the workbook, enter the password, confirm it, and save the file. The exact dialog wording can vary by release, so check that you are setting a password to open rather than only a password to modify.

Excel for the web cannot open or edit a workbook encrypted with an opening password. Download the file and open it in a compatible desktop version of Excel to work with it. If browser-based collaboration is essential, consider whether a password-encrypted file is the right workflow; managing access through OneDrive or SharePoint permissions may be more convenient, though it serves a different purpose.

When exchanging a workbook across Windows and Mac, test it on the recipient’s version before depending on it for an important deadline. Keep the password separate from the file. Sending the workbook and its password in the same message or conversation gives a recipient little practical separation between the two.

Set a password you can manage safely

A password that is easy to guess defeats much of the benefit of encryption. Avoid names, birthdays, company names, simple sequences, and passwords reused from email or other accounts. A longer, unique passphrase is generally easier to remember than a short string of complicated characters. A reputable password manager can generate and store a unique password, which is particularly useful for workbooks that are rarely opened.

Plan how authorized colleagues will get the password. Use a separate, approved channel, and share it only with people who need access. If an organization has rules for confidential data, follow its approved storage and sharing process; a personally chosen workbook password may not meet those requirements. Do not put the password in a nearby worksheet, filename, or note saved beside the workbook.

Before applying encryption to an important file, keep an authorized backup in a secure location and make sure the people who need the workbook can still access it. A backup should be protected too: an unencrypted duplicate can undermine the security of the encrypted original. Limit backup access and follow your organization’s retention rules.

Change or remove the password

To change or remove an opening password in Excel for Windows, open the workbook with its current password and go to File > Info > Protect Workbook > Encrypt with Password. In the password box, replace the existing password to change it, or delete the characters so the box is empty to remove it. Confirm the dialog and save the workbook. Close and reopen it to check the result.

On a Mac, use File > Passwords to update or clear the password to open, then save the workbook. Be careful to clear the opening-password field rather than changing a separate modify-password setting if the dialog shows both. Menu details can differ between releases.

Removing the password leaves the workbook readable without that password, so do it only when that is intended. If you are changing a password on a shared file, tell authorized users through a suitable channel and update any approved records or password-manager entries. Otherwise, people may keep trying the old password or lose access.

Common problems and misconceptions

  • The password prompt does not appear: Confirm that you used Encrypt with Password, not Protect Sheet or Protect Workbook for structure. Save, close the file, and reopen it to check.
  • The password is rejected: Check capitalization, keyboard layout, and accidental spaces. Try the password manager entry or the approved secure record rather than repeatedly guessing.
  • You forgot the password: Microsoft does not provide a way to recover a forgotten workbook-opening password. Excel cannot simply reset it for you. Look for a legitimate backup or an earlier unencrypted version that you are authorized to use.
  • The file will not open in a browser: An encrypted workbook needs a compatible desktop application; Excel for the web does not open it.
  • A protected sheet still shows private data: That is expected. Sheet protection governs editing, not confidentiality. Use file encryption if the contents must be hidden until a password is supplied.

Do not confuse a forgotten opening password with a forgotten sheet-protection password: they apply to different controls. If sensitive data is involved, avoid uploading the workbook to an unfamiliar password-removal service. Such a service may expose the file, and a third party cannot establish your right to access it.

When another security approach may fit better

If your main concern is controlling who can access a shared workbook, use the permissions available in OneDrive or SharePoint and grant access only to intended people. Those permissions can be changed without distributing a separate workbook password, but they do not make a downloaded copy safe if someone already has it. For sensitive business information, ask your organization about its approved classification, encryption, or rights-management tools.

If your goal is simply to prevent coworkers from accidentally overwriting formulas, worksheet protection may be more convenient than encrypting the file. You can combine controls when appropriate: manage access to the shared location, encrypt a file that must remain private when downloaded, and protect sheets against unintended edits. Each addresses a different risk, so do not treat one as a replacement for all the others.

Frequently Asked Questions

Can I password-protect only one sheet in Excel?

You can protect a worksheet through Review > Protect Sheet, but that restricts editing rather than making its contents confidential. If someone must not read the sheet’s data, do not rely on worksheet protection; use file encryption or a suitable access-controlled design.

Can I password-protect an Excel file without opening it?

To set or change the workbook’s opening password, open it in a compatible desktop version of Excel and use its password settings. If you cannot open an encrypted workbook because you do not know its password, Excel does not provide a reset option.

Can Excel for the web open a password-protected workbook?

No. Excel for the web cannot open or edit a workbook encrypted with a password to open. Use desktop Excel or another compatible desktop application, and check compatibility before sharing the file.

What happens if I forget the Excel password?

You may be unable to open the encrypted workbook. Microsoft cannot recover or reset the forgotten opening password. Check a password manager, an approved record, or a secure backup you are authorized to use.

Is Protect Sheet the same as encrypting a workbook?

No. Protect Sheet limits changes to a worksheet, while Encrypt with Password requires a password to open the workbook. Use encryption for restricting access to the saved contents and sheet protection mainly to prevent unwanted edits.

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.