How to Password Protect an Excel File (Windows, Mac & Web)
Locking an Excel file with a password is one of the simplest ways to keep sensitive data — payroll figures, client lists, financial models — from being opened or edited by the wrong person. Excel has built-in protection tools that don't require any third-party software, but the options available to you depend on your version of Excel, your operating system, and exactly what you're trying to protect.
What "Password Protecting" an Excel File Actually Means
Excel offers two distinct types of password protection, and mixing them up is a common source of confusion:
- Open password (encryption password): Prevents the file from being opened at all without the correct password. The file contents are encrypted using AES-128 or AES-256 depending on the Excel version.
- Modify password (write protection): Allows anyone to open and view the file, but requires a password to save changes to the original. Without it, the file opens in read-only mode.
These can be used together or independently. For truly sensitive data, an open password with encryption is the meaningful protection — a modify password alone doesn't prevent someone from copying the content.
There's also a third layer worth knowing: sheet-level protection, which locks specific worksheets or cell ranges within an already-open workbook. This is separate from file-level password protection and is typically used to prevent accidental edits rather than unauthorized access.
How to Add a Password in Excel for Windows
The most straightforward method works across Excel 2016, 2019, 2021, and Microsoft 365:
- Open the file you want to protect
- Go to File → Info → Protect Workbook → Encrypt with Password
- Enter a password and confirm it
- Save the file — the password takes effect on the next open
To set a modify (write protection) password, the path is slightly different:
- Go to File → Save As → More Options (or press F12)
- In the Save dialog, click Tools → General Options
- Enter a password in the "Password to modify" field
- Save the file
🔒 Both methods store the protection settings inside the .xlsx or .xlsb file itself, so the file carries its protection wherever it's sent.
How to Password Protect Excel Files on a Mac
The process on macOS follows a similar logic but uses a different menu path:
- With the file open, go to File → Passwords
- A dialog box appears with fields for both an open password and a modify password
- Enter your chosen password(s), confirm, and click OK
- Save the file
This method is available in Excel for Mac 2016 and later. The encryption standard applied is consistent with the Windows version when saving in .xlsx format.
Excel Online and Microsoft 365 Web App
Excel for the web (browser-based) currently does not offer a built-in option to set or change file encryption passwords directly in the browser. If a file already has an open password applied, Excel Online will prompt for that password before opening — but you can't add or remove encryption from within the web interface alone.
To apply password protection to a file you're editing in the browser, you'd typically need to download it and use the desktop application, or use OneDrive's file-sharing permissions as an access-control layer instead.
What Variables Affect Which Method You Should Use
Not all protection needs are the same, and several factors shape which approach makes sense:
| Factor | Why It Matters |
|---|---|
| Sensitivity of the data | Payroll or financial data warrants full encryption (open password); a shared team tracker may only need sheet protection |
| Who needs access | A file shared with many users is harder to manage with a single password |
| Excel version | Older .xls format uses weaker encryption than modern .xlsx; always prefer .xlsx |
| Platform | Mac and Windows paths differ; web-based Excel lacks full protection controls |
| Collaboration needs | Heavy co-authoring workflows may conflict with file-level password protection in SharePoint/OneDrive |
Sheet-Level vs. File-Level Protection: A Key Distinction
If your goal is to prevent edits to specific cells or worksheets — rather than restrict access to the file entirely — Excel's Protect Sheet feature (found under the Review tab) is the right tool. You can lock formula cells while leaving data-entry cells editable, or protect named ranges with individual passwords.
This type of protection is not encryption. It's a usage restriction, not a security barrier. Someone with enough Excel knowledge can work around sheet protection, so it shouldn't be relied upon for genuinely sensitive data.
Passwords Excel Cannot Recover 🔑
This is worth emphasizing clearly: Excel does not store a backup of your password. If you lose or forget the open password on an encrypted file, Microsoft provides no recovery mechanism. The encryption is real — the data is genuinely inaccessible without the correct password.
This makes password management — using a password manager, documenting the password in a secure location — an important part of any Excel protection workflow, particularly for files that need to remain accessible over months or years.
The Part That Depends on Your Setup
The mechanics of applying a password to an Excel file are consistent and well-documented. What varies is how much protection you actually need, how the file will be shared and stored, and which version of Excel the people accessing it are using. A file encrypted on a Windows desktop opens fine on Mac or in newer Excel versions — but the experience of managing passwords across teams, cloud storage platforms, and different Office licenses introduces variables that the feature itself doesn't resolve. Your specific workflow, storage environment, and the sensitivity of what you're protecting are what determine whether Excel's built-in tools are sufficient on their own.