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

When you password-protect an Excel workbook, Windows or Mac encrypts the file. Anyone who tries to open it sees a password prompt before the spreadsheet appears. This works in Excel 2016 and later on both Windows and Mac, and in Excel Online through your browser.

The process takes less than a minute. You do not need to install anything or change how you normally save files — you just add a password during the save step. Once protected, the file stays protected every time you open and close it, unless you remove the password later.

Key Takeaways

  • Open the file you want to protect, then use File > Save As and choose a location to save it.
  • Click Tools (Windows) or Options (Mac) in the Save As dialog, then enter your password in the encryption field.
  • Re-enter the same password to confirm it, then complete the save — the file is now protected.
  • Anyone opening the file will need the password; if you forget it, Microsoft cannot recover it for you.
  • Password protection encrypts the file itself, separate from sharing permissions or worksheet locks.

How to protect a workbook on Windows

Open the Excel file you want to protect. Click File in the top left, then click Save As. Choose where you want to save the file — your computer, OneDrive, or another location — and pick a folder.

At the bottom of the Save As dialog, you will see a Tools button. Click it, then select General Options from the dropdown menu. A small dialog box appears with two password fields: one says "Password to open" and one says "Password to modify".

Type your password in the Password to open field. This is the one that matters for basic protection — it prevents anyone from opening the file without the password. Leave the "Password to modify" field blank unless you want a second password that lets people view the file without editing it (a less common setup). Click OK.

Excel asks you to re-enter the password to confirm it. Type it exactly the same way — passwords are case-sensitive, so "MyPassword" is different from "mypassword". Click OK again. Now click Save to finish. The file is now password-protected.

How to protect a workbook on Mac

Open the Excel file you want to protect. Click File at the top, then click Save As. Choose where to save the file and enter a filename if you want to change it.

Before you click Save, look for an Options button near the bottom of the dialog. Click it to expand the options section. You will see a checkbox that says Encrypt with password. Check that box.

A password dialog appears. Enter your password in the field, then click OK. Excel asks you to re-enter it to confirm — type it the same way, paying attention to uppercase and lowercase letters. Click OK again, then click Save. Your file is now protected.

What happens after you protect the file

The next time anyone opens the file — including you — Excel shows a password prompt before the spreadsheet loads. They must type the correct password to proceed. If they type it wrong, they can try again, but they cannot open the file without the right password.

The protection stays in place every time the file is opened and saved. You do not have to re-enter the password each time you work on it during the same session, but closing and reopening the file will trigger the prompt again.

If you want to remove the password later, open the file, go to File > Save As, click Tools (Windows) or Options (Mac), and delete the text from the password field. Save the file, and the protection is gone.

Password strength and what to avoid

Use a password that is at least 8 characters long and mixes uppercase letters, lowercase letters, numbers, and symbols — something like "Budget2024!Q3" is stronger than "password". Avoid using your name, your company name, or common words that appear in a dictionary.

Write your password down somewhere safe if you think you might forget it. Microsoft cannot recover a lost password, and there is no "forgot password" option for encrypted files. If you lose the password, the file becomes inaccessible.

Password protection versus other security options

Password protection (encrypting the file) is different from worksheet protection, which locks specific cells or sheets but does not prevent someone from opening the file. It is also different from sharing permissions, which control who can access a file stored in OneDrive or SharePoint.

If you want to prevent editing but allow viewing, you can use the "Password to modify" field during the save step. This creates two passwords: one to open the file and one to make changes. Someone without the modify password can still open and read the file, but they cannot save changes under the original filename.

For files stored in OneDrive or SharePoint, you can also set sharing permissions to control who sees the file at all. Password protection and sharing permissions work together — you can use both on the same file.

Frequently Asked Questions

Can I password-protect a file that is already shared with others?

Yes. If the file is in OneDrive or SharePoint, password protection encrypts it on top of the sharing settings. People who already have access will still need the password to open it. If you add a password to a file that others are using, tell them the new password so they can continue working.

What if I forget the password?

There is no recovery option. Microsoft does not store your password and cannot unlock the file for you. The file will remain locked. This is why writing down your password in a find location is important — a password manager or a locked drawer both work.

Does password protection work in Excel Online?

You cannot set a password in Excel Online itself. You must protect the file in the desktop version of Excel first, then upload it to OneDrive or SharePoint. Once protected, anyone opening it through Excel Online will see the password prompt.

Can someone crack or bypass the password?

Excel uses encryption that is difficult to break with current tools, but it is not military-grade. For highly sensitive financial or legal documents, password protection is a reasonable first layer. For extremely sensitive files, consider additional security measures like storing them offline or using specialized encryption software.

Do I need to re-protect the file every time I save it?

No. Once you protect a file with a password, the protection stays in place automatically. Every time you save changes, the file remains encrypted. You only need to set the password once, when you first protect it.