Password protection in Excel locks your file so only someone with the password can open it or edit it

Excel has a built-in password feature that encrypts your file. When you set a password, the file becomes unreadable without it — even if someone copies the file to their own computer, they cannot open it without entering the correct password first. This works the same way in Excel on Windows, Mac, and in Excel Online.

The process takes about two minutes and requires you to remember the password you set. If you forget it, Microsoft cannot recover it for you, and the file becomes inaccessible. So write down your password somewhere secure before you close the file for the first time.

Key Takeaways

  • Password protection encrypts your Excel file so it cannot be opened without the correct password, whether someone has the file or not.
  • On Windows, go to File > Info > Protect Workbook > Encrypt with Password; on Mac, go to File > Properties > Security.
  • Excel passwords are case-sensitive, so "MyPassword" and "mypassword" are different — write down exactly what you typed.
  • If you forget your password, there is no recovery option; Microsoft cannot unlock the file for you.
  • Password protection encrypts the file itself, but does not prevent someone from copying or deleting it if they have access to your computer or cloud folder.

Password protection on Windows Excel

Open the file you want to protect. Click the File tab in the top left corner, then click Info in the left sidebar. Look for a button labeled Protect Workbook — it may say "Protect Workbook" or show a shield icon. Click it and select Encrypt with Password from the dropdown menu.

A dialog box will appear asking you to enter a password. Type your password in the field. Excel does not show what you are typing, so type slowly and carefully. Click OK. Excel will ask you to type the password again to confirm it matches. Type it exactly the same way — passwords are case-sensitive, meaning capital letters matter. Click OK again.

Excel will close and reopen the file. The next time you or anyone else tries to open this file, they will see a password prompt before the spreadsheet appears. Save the file after you set the password; if you close it without saving, the password will not be applied.

Password protection on Mac Excel

Open the file you want to protect. Click File in the menu bar at the top of the screen, then click Properties near the bottom of the dropdown menu. A dialog box titled "Properties" will open.

Look for a section labeled Security with a checkbox next to "Password to open". Check that box. A field will appear asking you to enter a password. Type your password carefully — it will not display on screen. Click OK. Mac will ask you to type the password again to confirm. Type it exactly the same way, then click OK.

Close the Properties dialog and save the file. The password is now active. The next time the file is opened, a password prompt will appear before the spreadsheet loads.

Password protection in Excel Online

Excel Online (the browser version you access through Microsoft 365 or OneDrive) does not have a built-in password feature within the application itself. Instead, the file is protected by your Microsoft account password and the folder permissions you set in OneDrive or SharePoint.

If you need password protection for a file stored online, download it to your computer, password-protect it using the Windows or Mac steps above, then upload it back to OneDrive or SharePoint. The password will remain active when you download and open it again later.

What password protection does and does not do

Password protection encrypts the file so it cannot be opened or read without the password. This protects against someone who has the file but does not have physical access to your computer — for example, if the file is emailed to the wrong person or left on a shared drive.

Password protection does not prevent someone with access to your computer or cloud account from copying, deleting, or moving the file. It only prevents them from opening it. If someone has your computer password or your OneDrive login, they can still delete a password-protected Excel file even though they cannot read it. For that reason, password protection works best alongside other security measures like a strong computer password and two-factor authentication on your cloud account.

Changing or removing a password

To change a password, open the file and enter the current password when prompted. Then follow the same steps you used to set the password originally — go to File > Info > Protect Workbook > Encrypt with Password (Windows) or File > Properties > Security (Mac). Enter your new password when asked. The old password will no longer work.

To remove password protection entirely, follow the same steps but leave the password field blank when prompted. Click OK without typing anything. The file will no longer require a password to open.

Passwords you should and should not use

Avoid passwords that are easy to guess: your name, your company name, "password", "123456", or any word found in a dictionary. These can be cracked in seconds. A stronger password combines uppercase and lowercase letters, numbers, and symbols — for example, "Blue$Marble7!" or "Desk#2024Coffee".

Do not use the same password for your Excel file that you use for your email, bank account, or other important accounts. If someone guesses or discovers your Excel password, you want to limit the damage to that one file. Write your password down on paper and store it somewhere secure, or use a password manager like Bitwarden or 1Password to store it encrypted on your device.

Frequently Asked Questions

What happens if I forget my Excel password?

There is no way to recover it. Microsoft does not store your password and cannot unlock the file. The file will remain inaccessible. This is why writing down your password or storing it in a password manager before you close the file is important.

Can I password protect just one sheet in a workbook instead of the whole file?

Yes. Go to File > Info > Protect Workbook and select "Protect Current Sheet" instead of "Encrypt with Password". This prevents someone from editing or deleting that specific sheet, but they can still open the file and see other sheets. Full file encryption (Encrypt with Password) is stronger because the entire file is locked.

Does password protection work if I save the file as a PDF?

No. When you save an Excel file as a PDF, the password does not transfer. You would need to set a separate password on the PDF using your PDF reader or a PDF tool. The Excel password only applies to files saved in Excel format (.xlsx or .xls).

Is my password stored somewhere I can see it later?

No. Excel does not show you your password after you set it. If you need to change it, you must enter the current password first. If you forget it, there is no recovery. Keep your password written down or stored in a password manager.

Can someone crack an Excel password?

Older Excel files (.xls format) have weak encryption and can be cracked with specialized tools. Newer files (.xlsx format) use stronger encryption. Neither is unbreakable if someone has significant time and computing power, but password protection stops casual access and protects against accidental sharing.