Password protection in Excel works differently depending on whether you want to lock the entire file or just prevent changes to specific sheets
Excel offers two main ways to add password protection. 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 content. Most people want file-level protection — locking the whole spreadsheet so only someone with the password can view it at all.
The steps differ slightly between Excel on Windows, Excel on Mac, and Excel Online. All three methods work, but they have different limitations. File-level passwords in Excel are encrypted, meaning Microsoft cannot recover a password you forget, so write it down somewhere safe before you close the file for the first time.
Key Takeaways
- File-level password protection locks the entire spreadsheet and requires a password to open it; sheet-level protection only prevents editing of specific sheets while keeping the file readable.
- On Windows and Mac, use File > Info > Protect Workbook > Encrypt with Password to password-protect the whole file.
- Excel Online does not support file-level password protection, so you must use the desktop version if you need to lock an entire file.
- If you forget a password, Excel cannot recover it, so store your password in a password manager or write it down before closing the file.
- Sheet-level protection prevents accidental changes but is not secure — it can be removed by someone with basic technical knowledge.
How to password-protect an entire Excel file on Windows
Open the spreadsheet you want to protect. Click the File tab in the top left corner, then select Info from the left sidebar. Look for a button labeled "Protect Workbook" — it may appear as a dropdown menu with a small arrow next to it.
Click "Protect Workbook" and select "Encrypt with Password" from the menu. A dialog box will appear asking you to enter a password. Type your password, then click OK. Excel will ask you to type the password again to confirm it. Once you confirm, save the file. The next time anyone tries to open this file, Excel will prompt them for the password before showing any content.
If you are using an older version of Excel (2010 or earlier), the path is slightly different: go to File > Save As, click Tools in the bottom left of the Save dialog, then select General Options and enter a password in the "Password to open" field.
How to password-protect an entire Excel file on Mac
Open the spreadsheet and click File in the menu bar at the top. Select "Protect Workbook" and choose "Encrypt with Password" from the submenu. A password dialog will appear. Enter your password and click OK, then type it again to confirm.
Save the file using Command+S or File > Save. The password protection takes effect immediately. On Mac, there is no separate "Save As" step needed — the protection applies to the file as soon as you confirm the password and save.
How to protect individual sheets instead of the whole file
Sheet-level protection is useful if you want to share a file with others but prevent them from accidentally (or intentionally) changing formulas, formatting, or specific data. This method does not encrypt the file — anyone can still open it — but they cannot edit protected sheets without a password.
To protect a sheet, right-click the sheet tab at the bottom of the window and select "Protect Sheet" (on Windows) or "Protect Sheet" (on Mac). A dialog box will appear. You can leave the password field blank if you just want to prevent accidental changes, or enter a password if you want to require one to unprotect the sheet. Check the boxes next to the actions you want to allow — for example, you might allow people to select cells but not insert rows. Click OK and confirm the password if you entered one.
Be aware that sheet-level protection is not truly secure. Someone with moderate technical knowledge can remove it using freely available tools. Use it only to prevent accidental changes, not to keep sensitive data hidden from determined users.
Why Excel Online does not support file-level password protection
If you use Excel Online (the browser version), you cannot password-protect an entire file through Excel's interface. Excel Online relies on your Microsoft account login and OneDrive or SharePoint permissions to control access, rather than file-level passwords.
If you need password protection, download the file to your computer, password-protect it using the desktop version of Excel, then upload it back to OneDrive or SharePoint. When someone tries to open it from the web, they will be prompted for the password. Alternatively, you can control who can access the file by adjusting your OneDrive or SharePoint sharing settings, though this is different from password protection.
What happens if you forget your password
Microsoft does not store your password and cannot recover it for you. If you forget a password-protected Excel file's password, the file is locked permanently. There is no official way to open it without the password.
Some third-party tools claim to crack Excel passwords, but they are unreliable and may contain malware. The safest approach is to prevent this problem: use a password manager like Bitwarden, 1Password, or the built-in password manager in your browser to store the password securely. If you prefer not to use a password manager, write the password on paper and store it in a safe place — a locked drawer, a safe, or with a trusted person.
How to remove password protection from a file you own
If you have the password and want to remove protection, open the file and enter the password when prompted. Then follow the same steps you used to add the password: go to File > Info > Protect Workbook > Encrypt with Password. This time, leave the password field blank and click OK. Save the file. The password protection is now removed.
For sheet-level protection, right-click the sheet tab and select "Unprotect Sheet." If the sheet has a password, you will be asked to enter it. Leave the password field blank if there was no password, or enter the password if there was one.
Frequently Asked Questions
Can I password-protect an Excel file and still share it with others?
Yes. You can give the password to people you want to share it with. They will need to enter the password to open the file, but once it is open, they can view and edit it normally. If you want them to view it but not edit it, use sheet-level protection instead, which allows the file to be opened but prevents changes to specific sheets.
Is Excel password protection secure?
File-level password protection in Excel is reasonably secure for casual use — it prevents accidental access and deters casual snooping. However, determined attackers with specialized tools may be able to crack older Excel passwords. For highly sensitive data, consider additional security measures like encrypting your entire hard drive or storing files in a password-protected cloud service with two-factor authentication.
Can I password-protect an Excel file on my phone or tablet?
Excel on mobile devices (iPhone, iPad, Android) does not have a built-in password protection feature. You must use the desktop version of Excel on Windows or Mac to add password protection. Once protected, you can open the file on your phone or tablet by entering the password, but you cannot add or remove protection from the mobile app.
What is the difference between a password to open and a password to modify?
Older versions of Excel allowed two separate passwords: one to open the file and one to modify it. The "password to open" locked the entire file, while the "password to modify" allowed viewing but required a password to make changes. Modern Excel uses only the "password to open" option for file-level protection. If you need both features, use file-level protection plus sheet-level protection on top of it.
Does password-protecting an Excel file slow it down?
No. Password protection does not affect how fast the file opens or how quickly Excel processes calculations. The only noticeable difference is that you will see a password prompt when you first open the file.