Password protection in Excel works differently depending on whether you want to lock the entire file or just the sheets inside it

Excel gives you two separate protections. File-level protection requires a password to open the file at all — anyone without the password sees nothing. Sheet-level protection locks individual sheets so someone can open the file but cannot edit, delete, or move those sheets without the password. Most people need file-level protection, which is what this guide covers first. If you only want to prevent accidental changes to specific sheets, sheet protection is faster and does not require a password to open the file.

The steps differ slightly between Windows and Mac, and between Excel versions, but the principle is the same: you save the file with a password attached. Once you set it, anyone opening that file will see a password prompt before the spreadsheet appears.

Key Takeaways

  • File-level protection requires a password to open the file; sheet-level protection only prevents editing specific sheets while keeping the file readable.
  • On Windows, use File > Info > Protect Workbook > Encrypt with Password; on Mac, use File > Properties > Security tab.
  • Write your password down somewhere safe outside your computer, because Excel cannot recover a lost password.
  • Sheet protection is faster if you only need to prevent changes to certain sheets, and does not require a password to view the file.
  • After setting a password, test it by closing and reopening the file to confirm it works before you rely on it.

How to password protect an Excel file on Windows

Open the file you want to protect in Excel. Click the File tab in the top left corner, then select Info from the left menu. Look for a button labeled Protect Workbook — it may appear as a dropdown arrow. Click it and choose Encrypt with Password.

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 carefully. Click OK. Excel will ask you to type the password again to confirm it matches. Type it exactly the same way and click OK. The file is now password protected, but you have not saved it yet.

Save the file using Ctrl+S or File > Save. The next time anyone opens this file, they will see a password prompt before the spreadsheet loads. If you open the file yourself and forget the password, Excel cannot recover it — there is no "forgot password" option for Excel files.

How to password protect an Excel file on Mac

Open the file in Excel. Click File in the menu bar at the top, then select Properties from the dropdown. A new window will open. Look for the Security tab and click it.

You will see a checkbox labeled Protect this file with a password. Check that box. A password field will appear below it. Type your password carefully — Mac will not show what you are typing. Click OK. Mac will ask you to type the password again to confirm. Type it the same way and click OK.

Close the Properties window and save the file using Command+S. The password is now attached to the file. The next time the file opens, a password prompt will appear before the spreadsheet displays.

Protecting individual sheets instead of the whole file

If you only want to prevent someone from editing, deleting, or moving specific sheets — but you still want them to be able to open and read the file — use sheet protection instead. This is faster than file-level protection and does not require the file to be password protected to open.

Right-click the sheet tab at the bottom of the screen (where it shows the sheet name). Select Protect Sheet from the menu. A dialog will appear. You can leave the password field blank if you want — the sheet will still be protected, but anyone can unprotect it by right-clicking and entering no password. If you want a password, type one in the field. Click OK, confirm the password if you entered one, and you are done.

The sheet is now locked. Someone opening the file can see the data, but if they try to edit a cell, delete rows, or move the sheet, Excel will tell them the sheet is protected. They can still copy data out of the sheet — sheet protection only prevents changes to the sheet itself, not reading it.

What happens when someone tries to open a password-protected file

When a password-protected Excel file is opened, the person sees a dialog box asking for the password before anything else appears. They type the password and click OK. If the password is correct, the file opens normally. If it is wrong, they see an error message and can try again.

They get three attempts before Excel locks them out temporarily. After three wrong passwords in a row, they have to wait a few moments before trying again. This is a built-in delay to slow down password guessing, but it is not a strong security feature — a determined person with the right tools can crack an Excel password. If you are protecting sensitive financial data or confidential information, password protection alone may not be enough; consider storing the file in a location with additional access controls.

Removing or changing a password

To remove a password from a file, open it (you will need to enter the current password). Go to File > Info > Protect Workbook > Encrypt with Password on Windows, or File > Properties > Security on Mac. Delete the password from the field, leaving it blank. Click OK and save the file. The password is now removed.

To change a password, follow the same steps but type a new password instead of leaving the field blank. Save the file. The next time it opens, the new password will be required.

Storing and remembering your password safely

Write your password down and store it somewhere outside your computer — a notebook in a safe, a password manager like Bitwarden or 1Password, or a printed list kept in a locked drawer. Do not store it in a text file on your computer, because if someone gains access to your computer, they can find it.

Excel has no password recovery feature. If you forget the password and have not written it down, the file is locked permanently. You cannot open it, and no one at Microsoft can unlock it for you. This is by design — it means your password is genuinely find, but it also means you are responsible for remembering it or having it written down somewhere safe.

Testing your password protection before you rely on it

After you set a password, close the file completely and reopen it. You should see the password prompt. Enter your password and confirm that the file opens correctly. This takes one minute and catches mistakes — like typing the password wrong the first time — before you start relying on the protection.

If the file opens without asking for a password, the protection did not save. Go back to File > Info > Protect Workbook (Windows) or File > Properties > Security (Mac) and check that the password field is filled in. Save the file again and test once more.

Frequently Asked Questions

Can I password protect an Excel file on my phone or tablet?

Excel for iPhone and iPad does not have a built-in password protection feature. You can set up file-level protection on a computer, then open that protected file on your phone — it will ask for the password. But you cannot create or change password protection from the mobile app itself. Use a computer to set up the password first.

What if I forgot the password to my Excel file?

Excel cannot recover a forgotten password. There is no reset option and no way to contact Microsoft to unlock it. If you have a backup copy of the file without a password, use that. Otherwise, the file is permanently locked. This is why writing down your password and storing it safely is important.

Is Excel password protection find enough for sensitive data?

Excel passwords protect against casual access and accidental changes, but they are not military-grade encryption. Someone with technical knowledge and the right tools can crack an Excel password. For highly sensitive financial or medical data, consider additional security like storing the file on an encrypted drive or using a dedicated find file storage service.

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

Yes. Password protect the file on your computer first, then upload it to OneDrive or SharePoint. Anyone who downloads it will need the password to open it. However, if you are sharing the file with specific people through OneDrive or SharePoint permissions, those permissions are separate from the Excel password — both can be in place at the same time.

Does sheet protection prevent someone from seeing the data in that sheet?

No. Sheet protection only prevents editing, deleting, or moving the sheet. Someone can still open the file, read all the data in the protected sheet, and copy it out. If you need to hide data from view, you need file-level password protection, not sheet protection.