Password protection in Excel works differently depending on whether you want to lock the whole file or just specific sheets
Excel offers two separate password features. You can password-protect the file itself so nobody can open it without the password, or you can protect individual sheets so people can open the file but cannot edit certain cells or sheets. Most people want file-level protection — that stops anyone without the password from seeing the spreadsheet at all. Sheet protection is useful if you want to share a file but prevent accidental changes to formulas or headers.
The steps differ slightly between Windows and Mac, and between Excel versions. This guide covers Excel 2019 and later on both systems, plus Excel Online. If you use an older version, the menu locations may differ, but the basic process is the same.
Key Takeaways
- File-level passwords prevent anyone from opening the spreadsheet without entering the password first.
- Sheet-level passwords let people open the file but prevent them from editing, inserting, or deleting rows and columns on protected sheets.
- Excel passwords are not recoverable — if you forget the password, Microsoft cannot retrieve it for you.
- Password-protecting a file does not encrypt it; a determined person with technical tools can still access the data, so do not rely on passwords alone for sensitive information.
- You can set different passwords for opening the file and for modifying it, so someone can view but not edit without the modification password.
How to password-protect an entire Excel file on Windows
Open the file you want to protect. Go to File in the top left, then click Info. Look for the button labeled Protect Workbook — it may say "Protect Workbook" or show a shield icon. Click it and select Encrypt with Password.
A dialog box will appear asking you to enter a password. Type your password and click OK. Excel will ask you to type the password again to confirm it. Once you confirm, save the file. The next time anyone opens this file, they will see a password prompt before the spreadsheet loads.
If you want to set separate passwords for opening and editing, use File > Save As instead. Click Tools (or the dropdown arrow next to Save) and select General Options. You can enter a password to open the file and a separate password to modify it. Someone with only the modification password can still open the file and view it, but cannot make changes.
How to password-protect an entire Excel file on Mac
Open the file and go to File in the menu bar. Click Protect Workbook and select Encrypt with Password. Type your password and click OK, then type it again to confirm. Save the file — the password takes effect immediately.
On Mac, the separate open and modify passwords are set through File > Save As. In the save dialog, click the dropdown arrow next to File Format and look for Options or Security Options. The exact location depends on your Excel version, but the option is usually near the bottom of the save dialog.
How to password-protect individual sheets
Sheet protection is useful when you want to share a file but prevent people from accidentally (or intentionally) changing formulas, deleting rows, or modifying the structure. The file itself remains unencrypted and opens without a password, but specific sheets are locked.
Right-click on the sheet tab at the bottom of the screen and select Protect Sheet. A dialog will appear with checkboxes for what users can do — by default, most actions are blocked. You can allow specific actions like "Select locked cells" or "Sort" while blocking "Edit objects" and "Insert rows". Enter a password if you want one (it is optional for sheet protection), then click OK.
Repeat this for each sheet you want to protect. Users can still open the file and view all sheets, but they cannot edit cells on protected sheets unless you have allowed that action in the protection settings.
How to password-protect a file in Excel Online
Excel Online (the browser version you access through OneDrive or Outlook) does not have a built-in password protection feature. If you need to password-protect a file stored in OneDrive, you have two options: download the file to your computer, password-protect it using the desktop version of Excel, and upload it back, or use OneDrive's sharing settings to restrict who can access the file.
To restrict access through OneDrive, right-click the file and select Share. Choose who can view or edit the file, and set an expiration date if needed. This is not the same as a password — it controls who OneDrive lets access the file — but it prevents unauthorized people from opening it.
What happens if you forget your password
Excel passwords cannot be reset or recovered by Microsoft. If you forget the password to open a file, you cannot access it without the password. If you forget a sheet protection password, you can unprotect the sheet without the password using third-party tools, but file-level passwords are much harder to bypass.
Write down your password somewhere secure — a password manager like Bitwarden or 1Password is better than a sticky note on your monitor. If you share the file with others, tell them the password through a separate channel (a phone call or a different email) rather than in the same message as the file.
Why password protection alone is not enough for sensitive data
Excel password protection is convenient for preventing accidental changes and keeping casual viewers out, but it is not encryption. Someone with technical knowledge and the right tools can extract data from a password-protected Excel file without knowing the password. If your spreadsheet contains truly sensitive information — financial records, health data, or personal details — password protection should be one layer of security, not the only one.
For highly sensitive files, consider storing them in a password-protected folder or using full-disk encryption on your computer. If you are sharing sensitive data with others, use a service like OneDrive or Google Drive with restricted sharing permissions, or send the file through a secure file transfer service rather than email.
Frequently Asked Questions
Can I password-protect just certain cells instead of the whole sheet?
Not directly. Sheet protection locks the entire sheet by default, but you can choose which actions are allowed. To protect only certain cells, first unlock the cells you want people to edit (right-click > Format Cells > Protection tab, uncheck "Locked"), then protect the sheet. Now only the unlocked cells can be edited.
What if I need to change the password later?
Open the file, go to File > Info > Protect Workbook > Encrypt with Password, and enter a new password. Save the file. The old password will no longer work. For sheet protection, right-click the sheet tab and select "Unprotect Sheet" (you will need the old password), then protect it again with a new password.
Can someone open a password-protected Excel file in Google Sheets?
Google Sheets can open Excel files, but it will prompt for the password first. Once open in Google Sheets, the file is no longer password-protected unless you set up Google's own sharing restrictions. If you upload a password-protected file to Google Drive, the password protection remains in place.
Does password protection work if I email the file to someone?
Yes. The password protection is part of the file itself, not the email. When the recipient opens the file, they will see the password prompt. The password does not travel with the email — you need to tell them the password separately.
Can I remove password protection from a file I own?
Yes, if you know the password. Open the file, go to File > Info > Protect Workbook > Encrypt with Password, and leave the password field blank. Click OK and save the file. The password protection is now removed.