The fastest way to password protect your Excel file

Open the file you want to protect in Excel. Click File in the top left, then Info. Look for a button labeled Protect Workbook (on Windows) or Protect (on Mac). Click it and select Encrypt with Password. Type your password twice and click OK. Save the file — Excel will now ask for the password every time someone opens it.

That password protects the entire file from being opened. If you want to let people open the file but prevent them from editing specific sheets or cells, you use a different feature called sheet protection, which works differently and is covered below.

Key Takeaways

  • File-level passwords (File > Info > Protect Workbook > Encrypt with Password) prevent anyone from opening the file without the password.
  • Sheet-level passwords (Review > Protect Sheet) let people open the file but stop them from editing, deleting, or moving specific sheets you choose.
  • Excel passwords are case-sensitive, so "MyPassword" and "mypassword" are different — write yours down somewhere safe.
  • If you forget a file-level password, there is no built-in recovery; you will need third-party software or to recreate the file.
  • Password-protecting a sheet does not hide the data — it just prevents editing — so use file-level encryption if the contents themselves must stay secret.

File-level passwords: preventing anyone from opening the file

A file-level password is the strongest protection. No one can even see the spreadsheet without entering the correct password first. To set one up on Windows, open your Excel file and click File > Info. Click the Protect Workbook button (it may say "Protect" on some versions). Select Encrypt with Password from the dropdown menu.

Type your password in the box that appears. Excel will ask you to type it again to confirm. Click OK. Save the file — you must save it for the password to take effect. The next time anyone opens this file, Excel will show a password prompt before the spreadsheet appears.

On a Mac, the steps are nearly identical. Open the file, click File > Info, then click Protect. Choose Encrypt with Password, type your password twice, and save. The behavior is the same: the file stays locked until someone enters the correct password.

Sheet-level passwords: letting people open the file but restricting edits

Sheet protection is different from file protection. It lets you share the file with others — they can open it and read it — but prevents them from changing, deleting, or moving specific sheets. The data is still visible; only the editing is blocked.

To protect a sheet on Windows, click the sheet tab at the bottom of the spreadsheet to select it. Go to Review > Protect Sheet. A dialog box will open. Type a password if you want one (it is optional for sheet protection). Check the boxes next to the actions you want to block — usually Insert Rows, Delete Rows, Delete Columns, and Edit Objects are already checked. Click OK, confirm the password if you set one, and save the file.

On Mac, select the sheet, then click Review > Protect Sheet. The same dialog appears. Set your password (optional), choose what to block, and click OK. Save the file.

Anyone who tries to edit a protected sheet will see a message saying the sheet is protected. If you set a password, they will be prompted to enter it — but only if they try to make a change. They can still read and copy data from the sheet.

Choosing between file-level and sheet-level protection

Use file-level passwords when the spreadsheet itself is confidential — financial records, personal information, or proprietary data that should not be seen at all. The file stays completely hidden until someone enters the password.

Use sheet-level passwords when you want to share the file with colleagues but prevent accidental or intentional changes to certain sheets. For example, you might protect a sheet that contains formulas or summary data while leaving other sheets editable. People can still open the file and read everything; they just cannot modify the protected sheets.

You can use both at the same time. A file can have a password to open it and also have individual sheets that are protected. This gives you two layers: first, the file itself is hidden; second, even if someone has the file password, they still cannot edit certain sheets without the sheet password.

What to do if you forget your password

If you forget a file-level password, Excel has no built-in recovery tool. You cannot open the file without it. Your options are limited: you can try third-party password recovery software (search for "Excel password recovery"), but these tools work only on older Excel versions and may not work on newer ones. For files created in Excel 2016 or later, recovery is usually not possible.

The best approach is to store your password somewhere safe — a password manager like Bitwarden, 1Password, or LastPass, or a physical notebook in a find location. If you use a password manager, you can retrieve the password anytime without having to remember it.

If you forget a sheet-level password, the situation is slightly better. You can still open the file and read the data. You just cannot edit the protected sheets. If you need to edit them, you would need to remove the protection, which requires the password — so again, storing it safely is important.

Password tips and common mistakes to avoid

Excel passwords are case-sensitive, meaning uppercase and lowercase letters are treated as different characters. "MyPassword" is not the same as "mypassword". Write down your password exactly as you typed it, including capitalization, or store it in a password manager.

Do not use passwords that are straightforward to guess — birthdays, names, or straightforward words. A strong password includes uppercase letters, lowercase letters, numbers, and symbols. Something like "Budget2024!Q3" is much harder to crack than "password".

Do not rely on sheet protection alone if the data is sensitive. Sheet protection only prevents editing; anyone with the file can still read and copy the data. If the contents must stay secret, use file-level encryption instead.

Test your password before you rely on it. Close the file, reopen it, and make sure the password works. This catches typos before you forget what you typed.

Removing or changing a password

To remove a file-level password, open the file (you will need to enter the current password). Click File > Info > Protect Workbook > Encrypt with Password. The password box will be empty. Leave it empty and click OK. Save the file. The password is now removed.

To change a file-level password, follow the same steps but type your new password instead of leaving the box empty. Confirm it and save.

To remove sheet protection, select the protected sheet, go to Review > Unprotect Sheet, enter the password if one was set, and click OK. To change a sheet password, unprotect the sheet first, then protect it again with the new password.

Frequently Asked Questions

Can I password protect just one sheet and leave others unprotected?

Yes. Sheet protection works on individual sheets, so you can protect some and leave others editable. Select each sheet separately and explore protection only to the ones you want to lock. People can edit the unprotected sheets freely.

What happens if I password protect a file and then forget the password?

You cannot open the file without the correct password. Excel does not have a password recovery feature for recent versions. Third-party recovery tools exist but rarely work on Excel 2016 and newer. Store your password in a password manager or find location.

Can someone copy data from a sheet-protected spreadsheet?

Yes. Sheet protection prevents editing, but not reading or copying. If you want to prevent people from seeing the data at all, use file-level password encryption instead.

Is there a difference between protecting a file on Excel Online versus desktop Excel?

Excel Online (the browser version) has limited protection options. File-level passwords work, but sheet protection is not available in the web version. If you need sheet-level protection, use the desktop version of Excel on Windows or Mac.

Can I protect a file that is shared on OneDrive or SharePoint?

Yes. File-level passwords work on shared files, but everyone who accesses the file needs the password. Sheet protection also works on shared files. Keep in mind that password-protecting a file does not replace OneDrive or SharePoint permission settings — use both together for full control.