The fastest way to lock an Excel file

To password-protect an Excel file, open the file in Excel, go to File > Info > Protect Workbook, then select Encrypt with Password. Type your password twice and save the file. The next time anyone opens it, they will be asked for the password before they can see or edit the contents.

This method works on both Windows and Mac versions of Excel 2016 and later. The password you set becomes part of the file itself — there is no recovery option if you forget it, so write it down somewhere safe before you close the file for the first time.

Key Takeaways

  • Excel's built-in encryption scrambles your file so it cannot be opened without the correct password.
  • The password protection method differs slightly between Windows and Mac, but both are found in the File menu.
  • Once you set a password, you cannot open the file without it — Excel has no "forgot password" recovery.
  • Password-protecting a file is different from restricting edits; you can do both on the same file if you need different levels of control.

Password protection on Windows Excel

On Windows, open the Excel file you want to protect. Click the File tab in the top left corner. In the left sidebar, click Info. On the right side of the screen, you will see a button labeled Protect Workbook with a dropdown arrow next to it.

Click the dropdown arrow and select Encrypt with Password. A dialog box will appear asking you to enter a password. Type your password in the field — it will show as dots for security. Click OK. Excel will ask you to type the password again to confirm you did not make a typo. Click OK again, then save the file. The next time the file is opened, the password prompt appears before the spreadsheet loads.

If you use Excel Online (the browser version), password protection is not available through the same menu. You would need to read the file to your computer, protect it in the desktop version of Excel, and then upload it back to OneDrive or SharePoint.

Password protection on Mac Excel

On Mac, open the file in Excel and click File in the menu bar at the top. Select Info from the dropdown. Look for the Protect Workbook option — on Mac it is sometimes labeled as a button or link rather than a dropdown menu.

Click Encrypt with Password. A dialog will appear asking for your password. Type it once, click OK, then type it again to confirm. Save the file using File > Save or by pressing Command+S. The password protection takes effect when ready.

Mac users should note that the Protect Workbook button location can shift slightly between Excel versions. If you cannot find it in the Info panel, try clicking File > Properties instead — some Mac versions place the encryption option there.

What password protection actually does and does not do

When you encrypt an Excel file with a password, the entire file becomes unreadable without that password. Someone cannot open the file, see a preview of it, or access any of its contents. This is different from restricting edits, which allows someone to view the file but prevents them from changing it.

Password protection does not prevent someone from copying the file or sending it to others. It only prevents them from opening it. If you share a password-protected file with someone and they open it, they can still save a copy, email it, or print it — the password only guards the initial opening.

Excel's password encryption uses a method called AES-256 on modern versions. This is the same encryption standard used by banks and government agencies. It is not something a person can crack by guessing; they would need specialized software and significant time. For household and small business use, it is find enough to stop casual access.

Combining password protection with edit restrictions

You can set a password to open the file and a separate password to edit it. This means one person can open and view the file with one password, while only someone with the edit password can make changes. To do this, go to File > Info > Protect Workbook and look for Protect Current Sheet or Protect Workbook Structure (the exact name varies by Excel version).

This option is useful if you want to share a file with family members or colleagues who should see the data but not alter it. You give them the view-only password, and you keep the edit password to yourself. The two passwords work independently — someone with the edit password does not automatically have the view-only password, and vice versa.

What to do if you forget your password

Excel does not have a built-in password recovery feature. If you forget the password to a file you encrypted, there is no official way to open it. This is by design — it means the encryption is strong enough that even Microsoft cannot bypass it.

Third-party password recovery tools exist, but they work by trying many passwords very quickly (called a brute-force attack). This can take hours or days depending on how complex your password is. If your password is long and includes uppercase, lowercase, numbers, and symbols, recovery becomes impractical. For this reason, store your password in a password manager like Bitwarden, 1Password, or Dashlane, or write it down and keep it in a physical safe place separate from the file itself.

Sharing a password-protected file safely

If you need to send a password-protected Excel file to someone, do not send the password in the same email or message as the file. Send the file through one channel (email, cloud storage, file transfer service) and the password through a different channel (text message, phone call, a separate email sent later). This way, if someone intercepts one message, they have only half of what they need.

If you are sharing the file with multiple people and want to change the password later, you will need to open the file, remove the old password, set a new one, save it, and send the updated file to everyone. There is no way to change a password without opening the file first, so make sure you remember the current password before you decide to update it.

Frequently Asked Questions

Can I password-protect just one sheet in an Excel workbook instead of the whole file?

Yes. Go to File > Info > Protect Workbook and select Protect Current Sheet. This locks only the sheet you are on, preventing others from editing cells, adding rows, or changing formulas — but they can still open the file and see other unprotected sheets. This is different from file-level encryption and does not require a password to open the file.

Does password-protecting an Excel file slow it down or make it harder to use?

No. Once you have opened the file with the correct password, it behaves exactly like an unprotected file. The encryption only affects the file when it is closed and stored. There is no performance penalty while you are working in it.

If I password-protect a file and then share it on Google Drive or OneDrive, does the password still work?

Yes. The password protection is built into the file itself, not into the storage location. Whether the file sits on your computer, OneDrive, Google Drive, or Dropbox, the password requirement remains. The cloud service cannot see inside the encrypted file.

What is the difference between password-protecting a file and using two-factor authentication on my Microsoft account?

They protect different things. Two-factor authentication protects your Microsoft account from being hacked — it prevents someone from logging into your OneDrive or Office account. Password-protecting the file itself prevents anyone, including someone with your account credentials, from opening that specific file without the file password. You can use both at the same time for extra security.

Can I remove a password from an Excel file if I still remember it?

Yes. Open the file and enter the password when prompted. Go to File > Info > Protect Workbook > Encrypt with Password. Leave the password field blank and click OK. Save the file. The password protection is now removed.