To encrypt an Excel file in Microsoft 365 for Windows, open the workbook and choose File > Info > Protect Workbook > Encrypt with Password. Enter a strong password, confirm it, and save the file. Anyone who opens the encrypted workbook will need that password to view its contents. Before you begin, make a backup and store the password somewhere secure: Microsoft cannot recover a forgotten workbook password.
What You’ll Need
- Excel for Microsoft 365 desktop on Windows. Excel for the web does not provide the desktop encryption command; use the desktop app to encrypt the workbook.
- A workbook saved in a format that supports password encryption, such as .xlsx or .xlsm. If your file is a CSV, save a copy as an Excel workbook first; CSV files do not retain Excel workbook encryption.
- A strong password and a safe way to retain it, such as an approved password manager. People who do not have the password will not be able to open the encrypted file.
- A separate backup of the original workbook, stored securely. Check that the backup is current and that you can access it before changing protection.
Step-by-Step
- Make a secure backup. Open the workbook and use File > Save As to create a separate copy in an appropriate location. Keep the backup protected too; an unencrypted copy in a shared folder defeats the purpose of encrypting the working file. If the workbook contains sensitive information, do not put the backup somewhere that people without a business need can access it.
- Check the file format. Look at the file extension in the Save As window or in File Explorer. For a CSV or another text-only format, choose File > Save As, select an Excel workbook format such as Excel Workbook (*.xlsx), and save a new copy. Excel may warn that some features cannot be kept in a different format. Review that warning and confirm the new workbook contains the data and features you need before protecting it. Use .xlsm if the file needs to retain VBA macros.
- Open the protection controls. In Excel for Microsoft 365 on Windows, select File to open Backstage view, then select Info. Choose Protect Workbook, and select Encrypt with Password from the menu. The command is for encrypting the whole workbook, not just stopping edits to one sheet. If the option is unavailable, confirm that you are using the desktop app and that the file is saved in a supported workbook format.
- Enter a password you can retain. Type the password in the password box and select OK. Use a long, unique password that is not the same as your Microsoft account password or a password used on another service. A memorable passphrase made from several unrelated words can be easier to store accurately than a short, complicated string. The password is case-sensitive, so uppercase and lowercase letters must be entered the same way when the workbook is opened.
- Confirm the password. Excel asks you to type the password again. Enter it exactly as before and select OK. If Excel reports that the passwords do not match, carefully re-enter both fields; check Caps Lock and the keyboard layout, especially if the password contains symbols. Do not assume that a password has been applied until you have saved and tested the file.
- Save the encrypted workbook. Select File > Save, or press Ctrl+S on Windows. Wait for the save to finish. If the workbook is stored in OneDrive or SharePoint, allow the sync to complete before you share a link or close Excel. The password protects the workbook file itself, while cloud sharing permissions determine who can reach the file; consider both controls when sharing sensitive information.
- Test the protection before sharing. Close the workbook, then open it again from its saved location. Excel should ask for the password before showing the workbook contents. Enter the password to confirm that it works and that the expected sheets and data are present. For a more complete check, close it again and make sure that a person who has not been given the password cannot open it. Do not use an unencrypted backup as the test copy.
- Share the password separately. Send the encrypted workbook using a suitable channel, and provide the password through a different, secure channel. Avoid putting the password in the same email or message as the file or link. Tell the recipient which password applies and, if appropriate, how to contact you if it does not work. Share only with intended recipients and review the file’s cloud access settings as well.
On Mac: The Windows ribbon path above does not apply. In Excel for Mac, use File > Passwords and set a password to open the workbook; the available password options can differ by Excel version. Save, close, and reopen the file to verify the prompt. If you do not see File > Passwords, update Excel or consult the Help search in your installed version. Excel for the web can open some password-protected files after a password is entered, but use the desktop app to set or change workbook encryption.
Common Mistakes
Confusing encryption with sheet protection. Review > Protect Sheet can restrict changes to cells, but it is not the same as encrypting a workbook with a password to open. A protected sheet may still be visible to someone who can open the file. Use File > Info > Protect Workbook > Encrypt with Password when your goal is to require a password before the workbook contents can be viewed.
Forgetting the password or its exact spelling. Passwords are case-sensitive, and a small difference in punctuation or spacing can prevent access. Keep the password in a secure password manager and confirm that it is saved correctly before closing the only open copy. Do not rely on a filename or a note stored beside the workbook as your sole reminder.
Protecting the wrong copy. A downloaded attachment, an older version, or an unencrypted backup may still be available to others. Check the file name and location before applying encryption, and review shared folders, email attachments, and cloud links for earlier copies. Encrypting the current workbook does not reach back and protect copies already sent.
Assuming encryption controls every kind of access. Encryption requires a password to open the file, but once an authorized person has opened it, they may be able to copy, print, or photograph information. It also does not replace sensible permissions on a shared drive or cloud account. Match the controls to the sensitivity of the data.
Tips
- Use a unique passphrase and store it in a password manager that you can access if your computer is lost or replaced. For a team workbook, establish a secure way to provide access to authorized colleagues and to update that access when roles change.
- Test the exact file you plan to send, not just a local draft. For a cloud file, wait for the upload or sync to finish, then reopen the copy from its shared location if practical. This helps catch cases where an older or unprotected version was uploaded by mistake.
- Keep a protected backup in a separate approved location. A backup helps with accidental deletion or file corruption, but it must have suitable access controls and a password you can retrieve. Periodically confirm that the backup is usable rather than assuming it is.
- If recipients only need to view the workbook, consider whether a password-protected PDF or a restricted sharing link is more appropriate. Those options have different trade-offs and do not make an unencrypted Excel copy safe. Choose the format and permissions based on what recipients need to do.
- Use the password-to-open option rather than a password that only limits editing if confidentiality is the goal. In Excel, passwords to modify and worksheet protection serve different purposes from file encryption. Read the wording of each prompt carefully before selecting an option.
Troubleshooting
You cannot find Encrypt with Password. Make sure you opened the workbook in the installed Excel desktop app, then select File > Info > Protect Workbook. Excel for the web has a reduced feature set and does not offer the same command for setting encryption. If the file is a CSV, save a copy as .xlsx or .xlsm first. A work or school administrator may also manage Office settings; ask your IT team if the command remains unavailable.
Excel does not ask for a password after you save. Confirm that you selected Encrypt with Password, rather than Protect Sheet or another protection option. Save the workbook, close every open window for that file, and reopen the saved copy from its actual folder. If it opens without a prompt, check whether you opened an older duplicate or a different file. Reapply encryption to the intended copy and test again before sharing.
The recipient says the password does not work. Confirm they are opening the encrypted file and not an older attachment. Send the password through a secure separate channel, and check capitalization, spaces, keyboard layout, and symbols. Ask them to type it rather than pasting if the copied text may include an extra space. If you suspect the password was exposed, open the workbook yourself, change the password, save it, and distribute the new password securely.
You forgot the password. First check your password manager, secure team records, or other approved storage. Microsoft does not provide a way to retrieve a forgotten password for an encrypted workbook. If you still have the file open on a device, do not close it until you have checked whether you can save an accessible, authorized copy or change the password. If no working copy or record exists, contact your organization’s IT support; do not use untrusted password-recovery downloads on sensitive files.
The workbook will not sync or open in another app. Confirm the upload completed and that the recipient’s Excel version supports the workbook format. Older software or third-party spreadsheet apps may handle password-encrypted files differently. Try the current desktop version of Excel and check that the file is not damaged by downloading a fresh copy from the source. If it contains macros, keep the .xlsm extension and follow your organization’s macro security rules.
Frequently Asked Questions
Does encrypting an Excel file protect the whole workbook?
Yes. Encrypt with Password requires a password to open the workbook, protecting access to its contents. It is different from protecting selected sheets or cells, which is intended to limit editing rather than require a password before viewing.
Can Microsoft recover a forgotten Excel encryption password?
No. Microsoft cannot retrieve a forgotten password for an encrypted workbook. Store it securely before closing the file, and keep a protected backup so a single mistake does not leave you without a usable copy.
Can I encrypt an Excel file in a browser?
Excel for the web does not provide the desktop command for setting workbook encryption. Open the workbook in Excel desktop, apply the password, save, and test it there. A browser may still be able to open a password-protected workbook when the correct password is supplied.
Is Protect Sheet the same as encrypting the file?
No. Protect Sheet can limit edits to a worksheet, but it does not require a password to open the workbook. To require a password before the file’s contents are available, use File > Info > Protect Workbook > Encrypt with Password on Windows.
Can I remove or change the password later?
Yes, if you know the current password and can open the workbook. In Excel for Windows, go to File > Info > Protect Workbook > Encrypt with Password, clear the password field to remove it, or enter a replacement password. Confirm the change, save, and reopen the file to verify the result.
Will the password protect copies I already sent?
It protects the encrypted file to which it was applied, not separate copies that were sent or saved earlier. Find and secure old copies where possible, and change the password if it may have been shared with someone who should no longer have access.
Related
- How to Delete Duplicate Values in Excel Without Losing Data
- How to Delete Empty Rows in Excel Without Losing Data
- How to Delete Duplicate Lines in Excel
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Table Creation: How to Set Up and Use TablesTo create an Excel table in Microsoft 365 for Windows, select a cell in a contiguous data range,…
- Excel Certifications: The Current Options ExplainedThe main Microsoft Excel certifications are Microsoft Office Specialist (MOS) Excel Associate for Microsoft 365 Apps (exam MO-210)…
- Excel Set Print Area to Fit on One Page: Steps and TipsTo set an Excel print area and fit it on one page, select the cells you want, choose…
- Switch Excel Number Format: Quick Steps and FixesTo switch an Excel number format, select the cell or range, then choose Home > Number Format and…
- Inclusive vs Exclusive Median in Excel Box Plots ExplainedIn an Excel box-and-whisker chart, Inclusive median includes the data-set median in both halves when the sample has…
- Excel Tips and Shortcuts for Faster, Cleaner WorkbooksFor faster Excel work, learn a few reliable Windows shortcuts, turn data ranges into tables, and use formulas…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.