How To Password Protect A Word Or Excel File (2026)
To password protect a Word or Excel file, open File, select Info, and choose Encrypt with Password.
The option sits under Protect Document in Word and under Protect Workbook in Excel.
The steps and warnings below come from Microsoft’s support pages for both apps.
Quick answer: where Encrypt with Password is
| App | Path |
|---|---|
| Word | File > Info > Protect Document > Encrypt with Password |
| Excel | File > Info > Protect Workbook > Encrypt with Password |
Read this before you set a password
Microsoft says it cannot recover a forgotten password for an encrypted Excel file.
Its Excel help also says that if you lose the password, you cannot open or gain access to the password-protected workbook.
Its Word page gives the matching advice to keep a copy of the password in a safe place if you think you might forget it.
Store the password somewhere safe before you close the file, such as in a password manager.
This guide only covers adding a password to your own file.
Password protect a Word document
- Open the document in Word.
- Select File, then Info.
- Select Protect Document.
- Choose Encrypt with Password.
- Type a password and select OK.
- Type the same password again and select OK to confirm.
- Save the file.
Microsoft notes the password only takes effect once the file is saved.
Password protect an Excel workbook
- Open the workbook in Excel.
- Select File, then Info.
- Select the Protect Workbook box.
- Choose Encrypt with Password.
- Enter a password in the Password box and select OK.
- Enter it again in the Reenter Password box and select OK.
- Save the workbook.
Microsoft’s page covers Excel for Microsoft 365, Excel 2024, Excel 2021, Excel 2019 and Excel 2016.
Password rules Microsoft gives
| Rule | Word page | Excel page |
|---|---|---|
| Case-sensitive | Yes | Yes |
| Length | Up to 15 characters | No length or character requirements |
| Advice | Use a strong password you can still remember | Pick one you will remember |
Because passwords are case-sensitive, check that Caps Lock is off when you type it both times.
What Encrypt with Password does
Microsoft describes file encryption as setting a password that stops other people from opening the file.
It calls this the most common technique for keeping others out of an Excel file.
It is different from the sheet and workbook protection on the Review tab, which control editing instead of opening.
The three protection levels in Excel
| Level | What it controls |
|---|---|
| File | Who can open or edit the whole file |
| Workbook | The structure, so people cannot add, move, delete, hide or rename sheets |
| Worksheet | What people can change inside one sheet, such as locked cells and formulas |
Microsoft states that worksheet protection is not a security feature.
It only stops people from changing locked cells, and it does not stop them from viewing the data.
If the goal is to keep a file private, use Encrypt with Password.
Lock the workbook structure with a password in Excel
Use this when people may open the file but must not rearrange its sheets.
- Select the Review tab.
- Select Protect Workbook.
- Enter a password in the Password box.
- Select OK, enter the password again to confirm, and select OK.
The password here is optional, but Microsoft says that without one any user can unprotect and change the workbook.
With the structure locked, other people cannot view hidden worksheets or add, move, delete, hide or rename worksheets.
Microsoft repeats the same warning for this password, saying Excel cannot recover it for you.
What the Review tab protection buttons do
| Button in the Protect group | Microsoft’s description |
|---|---|
| Protect Sheet | Protects the worksheet and the contents of locked cells |
| Protect Workbook | Protects the workbook structure and windows |
| Allow Edit Ranges | Sets which ranges can be edited |
How to tell a workbook is already protected
- On the Review tab, the Protect Workbook icon is highlighted.
- Sheet tab commands such as Insert, Delete, Rename, Move, Copy, Hide and Unhide are unavailable.
- File > Info shows the status next to Protect Workbook.
Other file-level options in Excel
| Option | What it is for | Requirement |
|---|---|---|
| Open and modify passwords | One password to open and another to modify, for read-only and edit access | None listed |
| Mark as Final | Flags the file as the final version and discourages changes | None listed |
| Restrict Access | Applies Information Rights Management permissions | Your organization must have IRM set up |
| Digital signature | Adds a signature to the file | A valid certificate from a certificate authority |
Which level to use
- Encrypt the file when only certain people should be able to open it, such as a status report for your team.
- Use separate open and modify passwords when some people should read and others should edit.
- Protect the workbook structure when each person edits their own sheet and nobody should add or delete sheets.
- Protect a worksheet when people enter data but must not delete rows, columns or formulas.
Microsoft says the levels can be combined, such as encrypting a shared file and also turning on workbook and worksheet protection.
A personal workbook might only need worksheet protection to avoid deleting formulas by accident.
Be careful when sharing a protected file
Microsoft warns that a password does not guarantee security.
Sharing the file or the password carries risk, because people you did not intend could get the password.
It advises thinking carefully before sharing workbooks that hold sensitive details such as credit card numbers, Social Security numbers or employee IDs.
Send the password separately from the file, and not in the same email.
Check that the password works
- Save and close the file.
- Open it again from File Explorer.
- Enter the password when the app asks for it.
Do this once before you delete any unprotected copy.
Related Word and Excel guides
- How to enable editing in Word Protected View or read-only
- How to fix an Excel file locked for editing
- How to recover an unsaved Word document