Password protection locks your Excel file so only someone with the password can open it or make changes
Excel lets you set a password in two ways: one that requires a password just to open the file, and another that lets anyone open it but requires a password to edit. You choose which one fits what you need. The steps differ slightly between Windows and Mac, but both take less than a minute once you know where to look.
Password protection is built into Excel itself — you do not need extra software or online services. The file stays on your computer, and only someone typing the correct password can access it the way you set it up.
Key Takeaways
- Excel has two password options: one to open the file at all, and one to allow opening but block editing without a password.
- On Windows, use File > Info > Protect Workbook > Encrypt with Password to lock the file from opening.
- On Mac, use File > Properties > Security to set an opening password, or Tools > Protect Sheet to lock editing only.
- Write your password down somewhere safe outside the file — if you forget it, you cannot recover the file without specialized tools.
- Password protection works on .xlsx files (the standard Excel format) and older .xls files, but not on .csv or .txt exports.
Setting a password to open the file on Windows
Open the Excel 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 or option labeled Protect Workbook — the exact wording varies by Excel version, but it is always in the Info section.
Click Protect Workbook and select Encrypt with Password. A dialog box appears asking you to type a password. Type it once, then click OK. Excel asks you to type it again to confirm you did not make a typo. Type it exactly the same way and click OK. Save the file using Ctrl+S or File > Save.
The next time anyone opens this file, Excel will ask for the password before the spreadsheet appears. Without the password, the file cannot be opened at all.
Setting a password to open the file on Mac
Open the Excel file. Click File in the menu bar at the top, then click Properties near the bottom of the menu. A dialog box opens with several tabs — click the Security tab.
You will see a checkbox labeled Password to open. Check that box. Type your password in the field that appears, then click OK. Mac asks you to type it again to confirm. Type it exactly the same way and click OK. Save the file using Command+S or File > Save.
Like Windows, the file now requires a password before it can be opened. Anyone without the password sees only a locked file.
Protecting the file from editing without opening a password
If you want people to be able to open and read the file but not change it without a password, use a different protection method. This is useful when you want to share a spreadsheet but prevent accidental or unauthorized changes.
On Windows, go to File > Info > Protect Workbook and look for an option like Protect Current Sheet or Protect Workbook Structure. On Mac, click Tools in the menu bar, then Protect Sheet or Protect Workbook. Both let you set a password that someone must enter to unprotect the sheet and make edits. The file opens normally, but editing is blocked until the password is entered.
This method is weaker than an opening password because the file itself is not encrypted — someone determined could potentially work around it. Use this when you want to prevent casual changes, not when you need serious security.
Passwords that work and passwords that do not
Excel passwords are case-sensitive, meaning MyPassword is different from mypassword. Use a mix of uppercase letters, lowercase letters, numbers, and symbols to make the password harder to guess. Avoid passwords based on your name, birthdate, or common words.
Do not use a password you have already used for other accounts or files. If someone gets into one account, they should not automatically get into everything else you own. A password manager like Bitwarden or 1Password can generate and store strong passwords so you do not have to remember them.
Write your password down on paper and store it somewhere safe — not in an email, not in a note on your computer, and not in the same file you are protecting. If you forget the password, there is no "forgot password" button. You will need specialized recovery software, and even that does not always work.
What happens when you share a password-protected file
When you email or upload a password-protected Excel file, the protection travels with it. The person receiving it will see the password prompt when they try to open it. You need to tell them the password separately — never in the same email or message as the file, since that defeats the purpose.
If you change your mind and want to remove the password, open the file with the password, go back to File > Info > Protect Workbook (Windows) or File > Properties > Security (Mac), and clear the password field. Save the file. The next time you open it, no password will be required.
Password protection and file format
Password protection only works on Excel files saved as .xlsx (the current standard format) or .xls (older Excel format). If you save the file as .csv or .txt, the password protection is stripped away and the file becomes unprotected.
Before sharing a file, check that it is saved as .xlsx or .xls. You can see the file type by looking at the filename — it should end with .xlsx or .xls. If you are not sure, right-click the file (or Control-click on Mac), select Properties or Get Info, and look for the file type listed there.
Frequently Asked Questions
Can I password protect just one sheet in a workbook, not the whole file?
Yes. On Windows, go to File > Info > Protect Workbook and choose Protect Current Sheet. On Mac, click Tools > Protect Sheet. This locks that sheet from editing but leaves other sheets in the same file unprotected. Anyone can still open the file and see all sheets — they just cannot edit the protected one without the password.
What if I forgot the password to my own file?
Excel has no built-in password recovery. You cannot call Microsoft and ask them to unlock it. Third-party password recovery tools exist, but they work by trying many passwords very quickly — success depends on how strong your password is. The safest approach is to keep a written copy of your password in a find location.
Does password protection encrypt the file or just lock it?
An opening password encrypts the file, meaning the data inside is scrambled and unreadable without the password. A sheet protection password does not encrypt — it just prevents editing. Someone with technical knowledge could potentially extract data from a sheet-protected file, so use opening passwords for truly sensitive information.
Can I use the same password for multiple files?
Technically yes, but it is not recommended. If someone learns the password, they get into all your files at once. Use a different password for each file, or at least for files containing different types of sensitive information. A password manager makes this easier by storing and filling in different passwords automatically.
Will password protection work if I upload the file to OneDrive or Google Drive?
Yes. The password protection is part of the file itself, not dependent on where it is stored. The file will be password protected whether it sits on your computer, OneDrive, Google Drive, or any other storage service. Anyone downloading it will still need the password to open it.