How to Add a Password to an Excel File (And What You Should Know Before You Do)

Protecting an Excel file with a password is one of the most straightforward security steps you can take for sensitive spreadsheet data — but the feature works differently depending on what you're trying to protect, which version of Excel you're using, and whether the file lives locally or in the cloud. Here's what you need to know.

Why Password Protection Matters in Excel

Excel files often carry data that shouldn't be freely accessible — financial records, employee information, client lists, or proprietary formulas. Without a password, anyone who can access the file location can open, edit, or copy the contents.

Excel offers two distinct layers of protection, and understanding the difference is important before you set anything up.

The Two Types of Excel Password Protection

1. Password to Open

This encrypts the entire workbook. Anyone who tries to open the file will be prompted for a password. Without it, the file appears as unreadable encrypted data. This is the stronger of the two options and uses AES-256 encryption in modern versions of Excel (2013 and later).

2. Password to Modify

This allows anyone to open and view the file, but restricts editing unless the correct password is entered. Readers can still see all the data — they just can't save changes to the original file. This is useful for shared documents where you want to allow viewing but control edits.

These two options can be used together or independently, depending on your needs.

How to Add a Password to an Excel File (Step by Step)

On Windows (Excel for Microsoft 365, Excel 2016, 2019, 2021)

  1. Open the Excel file you want to protect.
  2. Click File in the top-left corner.
  3. Select Info from the left-hand menu.
  4. Click Protect Workbook.
  5. Choose Encrypt with Password.
  6. Enter your password and click OK.
  7. Re-enter the password to confirm, then click OK.
  8. Save the file — the password won't apply until you save.

For a password to modify, the path is slightly different:

  1. Go to File > Save As.
  2. Click More options (or Browse to open the Save dialog).
  3. In the Save dialog, click Tools (bottom-left area).
  4. Select General Options.
  5. Enter a password in the Password to modify field (and optionally the Password to open field).
  6. Click OK, confirm the password, then save.

On Mac (Excel for Microsoft 365 or Excel 2019/2021 for Mac)

  1. Open your file.
  2. Click the Review tab in the ribbon.
  3. Select Protect Workbook or Protect Sheet, depending on what you need.
  4. Alternatively, go to File > Passwords to access both open and modify passwords in one dialog.
  5. Enter and confirm your password, then save.

🔒 Important: Excel's password protection is only as secure as the password itself. Short or obvious passwords are easy to brute-force with widely available tools.

Sheet-Level vs. Workbook-Level Protection

Beyond file-level passwords, Excel also lets you protect individual sheets within a workbook. This is different from encrypting the file.

Protection TypeWhat It DoesEncryption?
Password to OpenEncrypts the entire file✅ Yes (AES-256)
Password to ModifyRestricts editing, file still readable❌ No
Protect SheetLocks cells/ranges within one sheet❌ No
Protect Workbook StructurePrevents adding/deleting sheets❌ No

Sheet protection is useful for collaborative environments where you want to lock specific cells (like formulas or headers) while leaving other areas editable. It doesn't encrypt data — someone with the right tools can still access the content.

Excel Online and Cloud-Stored Files

If your Excel file is stored in OneDrive or SharePoint, the password-to-open feature behaves differently. Microsoft 365's web version of Excel doesn't currently support setting or opening files with encryption passwords through the browser. You'll need to use the desktop app to apply or remove that protection.

For cloud collaboration, many users rely on OneDrive or SharePoint's built-in sharing permissions instead — controlling who can access or edit the file at the folder or link level rather than encrypting the file itself.

A Critical Warning About Lost Passwords

Microsoft cannot recover a lost password for an encrypted Excel file. This is by design — the encryption is genuine. If you forget the password to open an encrypted workbook, the data is effectively inaccessible through normal means.

Sheet and workbook structure passwords are less robust and can sometimes be bypassed, but file-level encryption passwords cannot. Write it down somewhere secure or use a password manager.

What Actually Determines Which Approach Makes Sense

Several factors shape which protection method fits a given situation:

  • Who needs access? A file shared with a large team behaves differently than one sent to a single recipient.
  • Where is the file stored? Local drive, network share, OneDrive, SharePoint, and email attachments each carry different access risk profiles.
  • What are you protecting? Formulas and formatting have different sensitivity levels than personally identifiable information or financial data.
  • Which Excel version are you and your recipients running? Older versions use weaker encryption standards. A file created in Excel 2010 with RC4 encryption is far less secure than one created in Excel 2016 or later using AES-256.
  • Technical comfort level? Password managers, organizational IT policies, and shared drive permissions all interact with Excel's built-in protection in ways that vary by environment.

The mechanics of setting a password are simple. Whether that password — or that protection method — is the right fit for your specific file, team, and workflow is a different question entirely, and one that depends on variables only you can see. 🔐