The fastest way to password protect an Excel file
To password protect an Excel file, open the file in Excel, go to File > Info > Protect Workbook, then select Encrypt with Password. Type your password twice and save the file. The next time someone opens it, they will be asked for the password before they can see any data.
This method protects the entire file — the person opening it cannot view, edit, or copy anything without entering the correct password. It takes about 30 seconds and works the same way in Excel for Windows, Excel for Mac, and Excel Online.
Key Takeaways
- File-level password protection (File > Info > Protect Workbook > Encrypt with Password) prevents anyone from opening the file without the correct password.
- Sheet-level protection (Review > Protect Sheet) lets people open and view the file but prevents them from editing specific cells or sheets you choose.
- Write down your password somewhere safe — Excel cannot recover a lost password, and you will not be able to open the file again.
- Password protection in Excel Online works the same way as desktop Excel, but you cannot protect individual sheets in the web version.
File-level protection: password to open the file
File-level protection is the strongest option. It stops anyone from opening the file at all without the password. To set it up, open your Excel file and click File in the top left corner. Then click Info from the menu on the left side.
Look for the Protect Workbook button (in Excel for Windows) or Protect Workbook under the File menu (in Excel for Mac). Click it and select Encrypt with Password. A dialog box will appear asking you to type your password. Type it once, then type it again in the second box to confirm. Click OK, then save the file. The next time the file is opened, Excel will ask for the password before showing any content.
Sheet-level protection: password to edit specific sheets
Sheet-level protection is weaker than file-level protection but more flexible. It lets people open and view the file, but prevents them from editing the cells, columns, or sheets you choose. Use this when you want to share a file with others but keep certain data locked.
To protect a single sheet, click the sheet tab at the bottom of the window to select it. Then go to the Review tab at the top and click Protect Sheet. A dialog box will appear. Type a password if you want one (it is optional for sheet protection), then click OK. You can choose which actions people are allowed to do — by default, they can select cells and view formulas but cannot insert rows, delete columns, or change cell contents.
To protect multiple sheets at once, right-click any sheet tab and select Protect Sheet. This applies the same protection to all sheets in the workbook. If you want different sheets to have different rules, you must protect them one at a time.
What happens when someone tries to open a password-protected file
When a file is encrypted with a password, the person opening it sees a dialog box asking for the password before anything else appears. They cannot cancel this dialog and view the file without entering the password. If they type the wrong password, Excel tells them it is incorrect and asks them to try again.
If the file is sheet-protected instead of file-protected, the file opens normally and people can see all the data. But if they try to edit a protected cell, a dialog box appears saying the sheet is protected and asking for the password. They can view and read the file freely — they just cannot change it.
Passwords you should never use and how to create a strong one
Do not use passwords that are straightforward to guess: your name, your birthday, "password", "123456", or the name of your company. These can be cracked in seconds. A strong password has at least 12 characters and mixes uppercase letters, lowercase letters, numbers, and symbols — for example, "BlueMoon$2024!Desk" or "Excel#FileProtect99".
Write your password down and store it somewhere safe and separate from the file itself — a locked drawer, a password manager like Bitwarden or 1Password, or a notebook you keep at home. Do not email it to yourself or store it in a note on your computer. If you forget the password, Excel cannot recover it, and you will not be able to open the file again.
Removing or changing a password
To remove a password from a file, open the file (you will need to enter the current password), then go to File > Info > Protect Workbook > Encrypt with Password. The password field will be empty. Leave it empty and click OK, then save the file. The password is now removed.
To change the password, follow the same steps but type your new password instead of leaving the field empty. Save the file. The old password will no longer work.
Password protection in Excel Online and shared files
Excel Online (the web version of Excel) supports file-level password protection the same way the desktop version does. Go to File > Info > Encrypt with Password, type your password, and save. However, Excel Online does not support sheet-level protection — you can only protect the entire file.
If you share a password-protected file through OneDrive, SharePoint, or email, the person receiving it will see the password prompt when they try to open it. They will need the password to view the file. Sharing the file does not remove the protection — the password stays in place no matter who has a copy.
Frequently Asked Questions
Can I password protect just one sheet in a workbook?
Yes. Click the sheet tab you want to protect, go to Review > Protect Sheet, type a password if you want one, and click OK. Other sheets in the same workbook will remain unprotected and editable. You can protect multiple sheets individually, each with a different password if you choose.
What if I forget my password?
Excel cannot recover a lost password. You will not be able to open a file protected with file-level encryption, and you will not be able to edit a sheet protected with sheet-level encryption. This is why storing your password somewhere safe and separate from the file is important.
Does password protection work if I save the file as a different format, like CSV or PDF?
No. If you save an Excel file as CSV, the password protection is removed because CSV files do not support encryption. If you want to protect a file and share it, keep it in Excel format (.xlsx or .xls). PDF files have their own password protection system, separate from Excel.
Can someone break a password-protected Excel file?
Older Excel files (.xls format) can be cracked with specialized tools, but modern Excel files (.xlsx format) use strong encryption that is very difficult to break without the password. Using a long, random password makes it much harder. For highly sensitive data, consider additional security like storing the file on an encrypted drive.
Do I need to enter the password every time I open the file?
Yes, if the file is encrypted with file-level protection. You will be asked for the password each time you open it. Excel does not save the password. For sheet-level protection, you only need the password if you try to edit a protected cell.