In Excel for Microsoft 365 on Windows, go to File > Info > Protect Workbook > Encrypt with Password. Enter and confirm a password, then save the workbook; that password encrypts the file and is required to open it. Excel for Mac has a password command under File > Passwords, while Excel for the web does not provide the desktop encryption command.
Find the command in Excel for Windows
Open the workbook in the Excel desktop app, then select File to open the Backstage view. Choose Info in the left column. In the workbook-protection area, open Protect Workbook and select Encrypt with Password. The button may appear as a dropdown, so choose the specific encryption command rather than another protection option.
Type a password in the dialog box and confirm it when Excel asks. Then save the file. Excel applies the password to the workbook file, and the saved version will request that password when someone tries to open it. If you do not save after setting the password, the change may not be written to the file.
If the workbook is new or has not yet been saved, save it in a normal Excel format such as .xlsx or .xlsm. The command is associated with protecting the file, not with a cell, worksheet tab, or formula. In some Excel builds, labels or the placement of commands can vary slightly, but the Windows route is through File, Info, and Protect Workbook.
What Encrypt with Password actually protects
Encrypt with Password protects access to the workbook as a file. A person who does not know the password cannot normally open the encrypted workbook in Excel and inspect its contents. This is the relevant option when a workbook contains information you do not want casual recipients or anyone who obtains a copy of the file to read.
Encryption is different from worksheet protection. A sheet password can restrict editing of locked cells or certain worksheet actions, but it is not a substitute for encrypting the file. Workbook-structure protection can prevent changes such as adding, moving, deleting, hiding, or renaming sheets. Neither feature should be mistaken for a password required to open an encrypted workbook.
There is also a difference between a password to open and a password that only limits editing. A person able to open a file may still be able to read its contents, even if Excel warns that editing is restricted. If confidentiality matters, use the open-password encryption command, not merely a setting intended to discourage changes.
Set, change, or remove the password
To set a password on Windows, use the command above, enter the password, confirm it, and save. Excel does not show you the original password later, so check that you have recorded it correctly before relying on the workbook as your only copy. It is sensible to close the file and reopen it once to confirm that Excel asks for the password and that the password works.
To change or remove a password, first open the workbook with its current password. Return to File > Info > Protect Workbook > Encrypt with Password. To change it, replace the existing entry with the new password and confirm. To remove it, clear the password field, select OK, and save the workbook. Reopen the saved file to check that the new setting took effect.
Removing the password means the saved workbook is no longer protected by that open-password encryption. If you want to keep a protected original while creating an unprotected copy, use Save As to make a separate file, remove the password from the copy, and verify which version you are sharing. Give the two files clear names so the protected and unprotected versions are not confused.
Excel for Mac and Excel for the web
In Excel for Mac, open the workbook and look for File > Passwords. The dialog lets you set a password to open the workbook; available choices and wording can differ by Excel release. After setting or changing the password, save the file. As on Windows, keep a secure record of the password and verify access by reopening the saved workbook.
Excel for the web does not provide the same Encrypt with Password command for adding or removing workbook encryption. Open the workbook in the desktop app instead: in the web version, use the option to open or edit it in the desktop application, then follow the Windows or Mac steps. Password-encrypted workbooks may also need to be opened in a desktop version of Excel rather than in the browser.
If the menu path on your Mac differs, check that you are using the installed Excel desktop app and not Excel in a browser. An organization can also manage access through Microsoft 365 or SharePoint permissions, but those permissions are separate from the password encryption stored in the workbook file.
Choose the right kind of protection
The right setting depends on what you need to prevent. Use file encryption when the goal is to keep the workbook unreadable to someone who does not have the password. Use sheet protection when the goal is to prevent accidental edits to formulas or layout while allowing the workbook to be opened. Use workbook-structure protection when you want to limit changes to the set or arrangement of worksheets.
- Need to keep the contents private: choose Encrypt with Password and use a password to open the file.
- Need recipients to view but avoid changing formulas: consider worksheet protection, while recognizing that it does not encrypt the workbook.
- Need to limit who can access a shared file: manage sharing permissions in OneDrive or SharePoint as well as considering file encryption.
- Need to prevent accidental edits, not deliberate access: sheet or workbook protection may be enough for that limited purpose.
These options solve different problems and can be combined. For example, a budget workbook shared with a small group might use an open password for confidentiality and sheet protection to reduce accidental changes to calculation cells. The open password does not decide who is allowed to edit after opening; a person who knows it may still be able to make a copy or alter content unless other controls apply.
Password safety and recovery
Choose a long, unique password that is difficult to guess. Reusing an email or account password is risky because anyone who learns it may be able to use it elsewhere. A reputable password manager can store the workbook password, or an organization can use an approved secure method to share it. Do not send the password in the same message or channel as the workbook when you can avoid it.
Excel does not provide a normal recovery process that reveals a forgotten workbook-encryption password. Microsoft support cannot simply retrieve a password that was set on the file. If the password is lost, look for an earlier unencrypted copy, a version-history entry, or a backup saved before encryption. This is why testing the password and keeping a secure record matters before distributing or archiving an encrypted workbook.
Encryption also has limits. Once someone with the password opens the workbook, they can view its contents and may be able to copy data, take screenshots, or save another version. Password encryption is not a replacement for limiting distribution, setting appropriate cloud-sharing permissions, or following an organization’s rules for sensitive information.
Common problems and how to fix them
If you cannot find Encrypt with Password, first confirm that you are using the Excel desktop application on Windows and have opened File > Info. The command is not on the Home ribbon beside font or cell-formatting tools. In a browser, use the desktop app. On Mac, check the File menu for Passwords rather than looking for the exact Windows dropdown.
If Excel accepts the password but the file does not ask for it later, make sure you saved the workbook after setting the password and that you reopened the protected copy, not a different file with a similar name. Look at the file location and extension, especially if copies exist in Downloads, email attachments, OneDrive, or a shared folder.
If a recipient cannot open the file, check the password carefully, including capitalization and accidental spaces. Confirm that they are opening the correct attachment and using a desktop version of Excel if the browser does not support that encrypted file. If the workbook is an older format, such as .xls, consider saving a separate copy in a current .xlsx or .xlsm format and applying protection to that copy; confirm compatibility and macros before replacing the original.
Frequently Asked Questions
How do I encrypt an Excel file with a password?
In Excel for Windows, select File > Info > Protect Workbook > Encrypt with Password, enter and confirm a password, and save. The password is required to open the saved workbook.
Is Protect Sheet the same as Encrypt with Password?
No. Protect Sheet is mainly for restricting worksheet changes; it does not make the workbook unreadable to someone who can open it. Encrypt with Password protects the file with a password required for opening.
Can I encrypt an Excel workbook in a browser?
Excel for the web does not offer the desktop Encrypt with Password command. Open the workbook in Excel for Windows or Mac to add or remove a file password.
What if I forget the Excel encryption password?
Excel does not offer a standard way to recover or display a lost open password. Check secure password records, backups, and earlier versions of the workbook.
Can I remove the password after encrypting the workbook?
Yes, if you know the current password and can open the file. Return to the encryption dialog, clear the password field, confirm, and save. Verify the saved copy by reopening it.
Before you share the workbook
Before sending a protected file, test it from the saved location and confirm that the intended recipient can open it with the password you provide. Keep an unencrypted working backup only if your storage location is appropriate for its contents, and control access to that backup. For shared business files, combine workbook encryption with sensible OneDrive or SharePoint permissions rather than assuming one password controls every copy or sharing route.
Related
- Excel Transpose Shortcut: Flip Rows and Columns Fast
- Transpose Key in Excel: Shortcut and Other Methods
- Tracking Sales in Excel: A Step-by-Step Tutorial
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Conditional Formatting for Overdue Dates in Excel: GuideIn Excel for Microsoft 365 on Windows, select the date cells, choose Home > Conditional Formatting > New…
- Excel AVERAGE Tips and Tricks for Everyday Spreadsheet TasksTo calculate the arithmetic mean in Excel, enter =AVERAGE(B2:B20), replacing the range with the cells containing your numbers.…
- How to Open an IQY File in Excel and Load Web DataTo open an IQY file in Excel for Microsoft 365 on Windows, choose File > Open > Browse,…
- Excel Shortcut for Filling a Cell YellowIn Excel for Microsoft 365 on Windows, press Alt, then H, then H to open the Fill Color…
- Excel Dependent Drop-Down Lists: Setup and FixesYes. In Excel for Microsoft 365 on Windows, create a drop-down for the first choice, then make the…
- How to Highlight a Box in ExcelTo highlight a box in Excel, select the cell or rectangular range, then choose Home > Fill Color…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.