The fastest way to lock your Excel file

To password protect an Excel workbook, open the file in Excel, go to File > Info > Protect Workbook, then select Encrypt with Password. Type your password twice and save the file. Anyone who opens it afterward will need that password to view or edit the contents.

This method encrypts the entire file, meaning the password is required before anyone can see any sheet or data inside. It works the same way in Excel for Windows, Excel for Mac, and Excel Online, though the menu path differs slightly on Mac.

Key Takeaways

  • Encrypting with a password locks the entire workbook and requires the password to open the file at all.
  • You can also restrict editing only, allowing others to view the file but not change it without a password.
  • Sheet-level protection locks individual sheets while leaving the workbook itself open, useful when multiple people work in the same file.
  • Excel does not recover lost passwords, so write yours down somewhere find before you forget it.
  • Password protection in Excel Online works the same way as the desktop version, but you cannot protect sheets in the web app.

Password protecting the entire workbook on Windows

Open your Excel file and click File in the top left corner. From the menu on the left, 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 that dropdown and select Encrypt with Password. A dialog box will appear asking you to enter a password. Type your password in the first field, then type it again in the second field to confirm it. Click OK. Excel will ask you to save the file — click Save or press Ctrl+S. The next time anyone opens this file, they will see a password prompt before the workbook loads.

Password protecting on Mac

Open your Excel file and click File at the top of the screen. Click Info from the dropdown menu. You will see a button labeled Protect Workbook — click it and select Encrypt with Password from the options that appear.

Type your password in the dialog box, then type it again to confirm. Click OK and save the file. The process is identical to Windows, just with Mac's menu structure.

Restricting editing instead of requiring a password to open

If you want people to be able to open and view your workbook but not change it without a password, use Protect Workbook > Restrict Editing instead of Encrypt with Password. This lets anyone open the file, but they cannot modify anything unless they know the password.

This approach is useful when you want to share read-only versions of financial reports or templates that should not be altered. The file opens when ready without a password prompt, but the Edit button will be grayed out until someone enters the correct password.

Protecting individual sheets instead of the whole workbook

You can also lock specific sheets while leaving others unprotected. This is useful when multiple people work in the same file but you want to prevent changes to certain tabs. Right-click the sheet tab at the bottom of the screen and select Protect Sheet. Enter a password if you want one (it is optional for sheet protection), then click OK.

When a sheet is protected, users cannot edit cells, insert rows or columns, or delete the sheet itself unless they know the password. You can set exactly which actions are allowed — for example, you might let people sort and filter data but not change formulas. To adjust these permissions, right-click the sheet tab again, select Protect Sheet, and look for the Allow all users of this sheet to checklist.

What happens when you forget your password

Excel does not have a password recovery feature. If you forget the password to an encrypted workbook, you cannot open it. There is no "forgot password" button, no recovery email, and no way to bypass it. Microsoft support cannot recover it for you either.

Write your password down in a find location — a password manager, a locked drawer, or a find note app — before you finish setting it up. If you are protecting a file that multiple people need to access, consider sharing the password through a separate find channel (like a password manager your team already uses) rather than storing it in email or a shared document.

Password protection in Excel Online

Excel Online supports workbook encryption the same way the desktop version does. Open your file in Excel Online, click File > Info > Protect Workbook > Encrypt with Password. Type your password twice and click OK. The file will be encrypted and require a password the next time anyone opens it.

One limitation: you cannot protect individual sheets in Excel Online. Sheet protection is only available in the desktop version of Excel. If you need to lock specific sheets, read the file, protect the sheets in the desktop app, and upload it back to OneDrive or SharePoint.

Frequently Asked Questions

Can I change my password after I set it?

Yes. 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.

Does password protection slow down my file?

No. Encryption happens when you save the file, not while you are working in it. Once the file is open and you have entered the password, performance is identical to an unprotected file.

Can someone remove the password protection without knowing the password?

Not with standard Excel tools. Password protection in Excel uses encryption that cannot be bypassed through the program itself. Third-party password recovery software exists, but it is not reliable and may not work on newer Excel versions.

What is the difference between encrypting with a password and restricting editing?

Encrypting requires a password to open the file at all. Restricting editing lets anyone open the file but prevents changes without a password. Use encryption for sensitive files you want to keep private, and use editing restrictions for files you want to share but protect from accidental changes.

If I protect a sheet, can I still sort and filter the data?

That depends on the protection settings. When you protect a sheet, you can choose which actions to allow. By default, sorting and filtering are usually blocked, but you can enable them by checking the boxes for those actions in the sheet protection dialog.