Password protection locks your spreadsheet so only people with the password can open it

Excel lets you add a password directly to the file itself. When someone tries to open it, they will be prompted to enter the password before they can see any of the data. This is different from sharing settings — the file stays on your computer or in your cloud storage, and the password is built into the file, not managed by a sharing service.

The steps differ slightly between Excel on Windows, Excel on Mac, and Excel Online. Windows and Mac versions let you set a password in seconds through the Save As dialog. Excel Online (the free version you use in a web browser) does not have a built-in password feature, so you would need to use the desktop version or rely on OneDrive folder permissions instead.

Key Takeaways

  • Password protection in Excel encrypts the file so it cannot be opened without the correct password, and this protection travels with the file if you email it or move it.
  • On Windows and Mac, you set the password through File > Save As, then click Tools or Options and choose to encrypt with a password.
  • Excel Online does not support password protection, so you must use the desktop app or protect the OneDrive folder instead.
  • If you forget the password, there is no recovery option — Microsoft cannot unlock the file for you, so write it down or store it in a password manager.
  • Password protection does not prevent someone from copying the file; it only prevents them from opening it without the password.

How to add a password on Windows

Open the spreadsheet you want to protect. Click File in the top left corner, then click Save As. Choose where you want to save the file — your computer, OneDrive, or another location — and give it a name.

Before you click Save, look for a button labeled Tools near the bottom right of the Save As dialog. Click it and select General Options. A small window will appear with two password fields: one for opening the file and one for modifying it. Type your password in the Password to open field. You can leave the second field blank if you only want to protect against opening. Click OK, then type your password again to confirm it, then click OK again. Now click Save to finish.

The next time anyone opens this file, they will see a password prompt before the spreadsheet appears. If they enter the wrong password, the file will not open.

How to add a password on Mac

Open your spreadsheet and click File at the top of the screen, then Save As. Give the file a name and choose where to save it. Before clicking Save, look for a button labeled Options near the bottom of the dialog.

Click Options and check the box next to Encrypt with password. A password field will appear. Type your password and click OK. You will be asked to type it again to confirm. Then click Save to complete the process.

On newer versions of Mac Excel, the Options button may be in a different location or labeled differently. If you do not see it, look for a small gear icon or a dropdown menu near the file name field.

What happens if you forget the password

If you forget the password, the file cannot be opened. Microsoft does not have a way to recover or reset passwords on encrypted Excel files. There is no back door, no recovery email, and no customer service option that can unlock it.

This is why it is important to write down the password somewhere safe — a physical notebook, a password manager like Bitwarden or 1Password, or a find note in your phone. If the file is critical and you lose the password, your only option is to start over with a new spreadsheet.

The difference between password protection and sharing permissions

Password protection and sharing permissions are two separate things. A password on the file itself means nobody can open it without the password, period. Sharing permissions (like those in OneDrive or Google Drive) let you decide who can view or edit a file you have shared with them, but they do not prevent someone from opening it if they have the link.

If you email an Excel file with a password to someone, they will need the password to open it, even if they have your email address. If you share a file through OneDrive with sharing permissions only, anyone with the link can open it (unless you restrict it to specific people). For maximum security, you can use both: password-protect the file and also limit who can access the OneDrive folder.

Why password protection alone does not prevent copying

A password stops someone from opening the file, but it does not stop them from copying the file itself to another location. If someone has access to your computer or your email, they can copy the password-protected file and send it to someone else. The password travels with the file.

If you need to prevent copying or sharing, you need a different approach: store the file in a OneDrive or SharePoint folder and control who has access to that folder, rather than relying on a password. You can also set permissions in OneDrive to prevent downloading, though this only works if people access the file through OneDrive, not if they have a copy of the file itself.

Password protection for Excel files stored online

If you save your Excel file to OneDrive or SharePoint, you can still password-protect it. The password is part of the file, so it works the same way whether the file is on your computer or in the cloud. When someone downloads the file from OneDrive and opens it, they will be prompted for the password.

However, if you only want to control who can see the file in the first place, it is often simpler to use OneDrive sharing settings instead. You can set a file to be viewable only by specific people, or you can turn off sharing entirely. This prevents the file from being accessed at all, rather than requiring a password once someone has it.

Frequently Asked Questions

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

Yes. Right-click the sheet tab at the bottom of the spreadsheet and select Protect Sheet. You can set a password so that sheet cannot be edited without the password. This is different from file-level protection — the file opens normally, but that specific sheet is locked. Other sheets in the same workbook can remain unprotected.

What if I want someone to open the file but not edit it?

In the Save As dialog, use the Password to modify field instead of (or in addition to) the password to open. This lets people open the file with a password, but they can only edit it if they know a second password. If they open it without the modify password, it opens in read-only mode.

Does password protection work if I save the file as a different format, like CSV or PDF?

No. Password protection only works on Excel file formats (.xlsx, .xls, .xlsm). If you save as CSV or PDF, the password protection is lost. You would need to set up protection again in the new format if it supports it.

Can I remove a password from a file if I know the password?

Yes. Open the file, enter the password when prompted, then go to File > Save As. In the Tools or Options dialog, delete the password from the password field and save the file. The next time you open it, no password will be required.

Is password protection the same as encryption?

In Excel, password protection uses encryption — the file is scrambled so it cannot be read without the password. So yes, they are the same thing in this context. The password is the key that unlocks the encrypted file.