The fastest way to lock an Excel file
To password protect an Excel file, open the file in Microsoft Excel, click File in the top left, then select Info. Look for the button labeled Protect Workbook and click the dropdown arrow next to it. Choose Encrypt with Password. Excel will ask you to type a password twice — type it the same way both times, then click OK. The next time someone opens that file, they will see a password prompt before the spreadsheet appears.
If you are using Google Sheets instead of Excel, the process is different: you cannot password protect a single sheet within Google Sheets, but you can control who can open or edit the entire file by clicking the Share button and setting permissions to "Viewer only" or "Editor only" for specific people. Google Sheets does not offer a password lock the way Excel does.
On a Mac running Excel, the steps are the same: File → Info → Protect Workbook → Encrypt with Password.
Key Takeaways
- Excel's password protection encrypts the entire file, so anyone without the password cannot open it at all — not even to view the data.
- You can also protect just the sheets inside a workbook (rather than the whole file) by going to File → Info → Protect Workbook → Protect Current Sheet, which lets people open the file but prevents them from editing or moving sheets.
- If you forget the password, there is no built-in recovery option — Excel does not store a backup copy, and you cannot undo the encryption.
- A password-protected Excel file is encrypted on your computer, so the password only works when someone tries to open the file; it does not protect the file if it is sent over email or stored in the cloud without additional security.
The difference between file passwords and sheet passwords
Excel offers two different types of password protection, and they do different things. A file password (also called "encrypt with password") locks the entire workbook. Nobody can open the file or see any of its contents without typing the correct password first. This is the strongest option if you want to keep the whole spreadsheet private.
A sheet password (also called "protect current sheet") is weaker. It lets people open the file and see the data, but it prevents them from editing cells, deleting rows, inserting columns, or moving sheets around. You might use this if you want to share a read-only version with coworkers, or if you want to let people see your formulas but not change them. To set a sheet password, go to File → Info → Protect Workbook → Protect Current Sheet, type a password, and click OK.
If you need both — a file that is locked to open, and sheets inside that file that are also locked to edit — you can set both passwords. Set the file password first, then set the sheet password. Anyone opening the file will need the file password, and then if they want to edit the sheets, they will need the sheet password too.
What happens when you password protect a file
When you encrypt an Excel file with a password, the entire file is scrambled using an encryption standard called AES-256. This is the same encryption that banks and government agencies use. Without the correct password, the file is unreadable — a person cannot open it, view it, copy it, or extract data from it, even with specialized software.
The password is not stored in the file itself. Instead, Excel stores a hash — a mathematical fingerprint of the password. When someone types a password to open the file, Excel compares the hash of what they typed to the hash stored in the file. If they match, the file unlocks. If they do not match, the file stays locked.
This means that if you forget your password, the file is locked forever. Microsoft cannot unlock it for you, and there is no "forgot password" recovery option. You cannot reset it or retrieve it. If the password is lost, the file is inaccessible. Write down your password and store it somewhere safe — a password manager, a locked drawer, or a trusted person — before you lock the file.
Passwords that are actually hard to guess
A password like "password123" or "excel2024" will lock your file, but it will not protect it well. Someone with basic tools can guess a short or common password in minutes. If your Excel file contains sensitive information — tax returns, medical records, financial statements, or personal data — use a password that is at least 12 characters long and includes uppercase letters, lowercase letters, numbers, and symbols.
A strong password for an Excel file might look like: Tr0pic@lSunset#42 or BlueMoon$Desk&2024. These are hard to guess because they mix character types and do not follow a pattern. Avoid passwords based on your name, birthday, address, or anything that appears in public records or on social media.
If you use the same password for multiple files, or the same password you use for email or banking, change that habit now. Each sensitive file should have its own unique password. A password manager like Bitwarden, 1Password, or KeePass can store unique passwords for each file so you do not have to remember them.
Password protection does not replace backups
Locking a file with a password protects it from being opened by someone without the password. It does not protect it from being deleted, corrupted, or lost. If your computer crashes, your hard drive fails, or you accidentally delete the file, the password will not bring it back.
Keep a backup copy of your password-protected Excel file in a separate location. This could be an external hard drive, a cloud storage service like OneDrive or Dropbox, or both. Store the backup in a place you control — not on a shared network drive where a coworker could delete it by accident. If the original file is damaged or lost, you can restore it from the backup.
Test your backup by restoring it to a different folder and opening it with the password. This confirms that the backup is actually readable and that you remember the password correctly.
Password protection and cloud storage
If you store a password-protected Excel file in OneDrive, Google Drive, Dropbox, or another cloud service, the password protection still works. The file is encrypted on your computer before it is uploaded, so the cloud service cannot read the contents even though it stores the file.
However, cloud storage adds a second layer of security — the login password for your cloud account. Someone who steals your cloud account password can read your files, but they still cannot open the Excel file without the Excel password. If you use a weak cloud password, that is a weak point. Use a strong, unique password for your cloud account too.
Be aware that if you share a password-protected Excel file with someone through cloud storage, they will need both the cloud account access and the Excel password to open it. Make sure you have a way to give them the Excel password securely — not in the same email as the file link, and not in a chat message. Use a separate conversation or a password manager that both of you can access.
When password protection is not enough
Password protection locks a file so it cannot be opened without the correct password. It does not hide the file from view, encrypt it on a network, or prevent someone from stealing the file itself. If someone has physical access to your computer, they can copy the password-protected file to a USB drive and take it with them. The password will still protect it, but they now have a copy.
If your Excel file contains highly sensitive information — employee records, financial data, trade secrets, or personal information about other people — consider whether password protection alone is enough. You might also need to:
- Store the file on an encrypted hard drive or encrypted USB drive, so the file is protected even if the device is stolen.
- Limit who has access to the folder where the file is stored, using file permissions on your operating system.
- Use a VPN or find network if you are accessing the file from a public WiFi network.
- Delete the file securely when you no longer need it, using a tool that overwrites the deleted data so it cannot be recovered.
Frequently Asked Questions
Can I change the password after I set it?
Yes. Open the password-protected file (you will need to type the current password), then go to File → Info → Protect Workbook → Encrypt with Password. Clear the old password field, type the new password twice, and click OK. The file will now open with the new password instead.
What if I share a password-protected file and the other person forgets the password?
You will need to open the file yourself, remove the password (by going to File → Info → Protect Workbook → Encrypt with Password and leaving the password field blank), save the file, and send them the unprotected version. There is no way to recover a forgotten password.
Does password protection work the same way in Excel Online?
No. Excel Online (the browser version) does not have a built-in password protection feature. If you need to password protect a file, use the desktop version of Excel. You can then upload the protected file to OneDrive or SharePoint, and it will stay protected when you open it in Excel Online.
Can someone crack an Excel password?
Older versions of Excel (before 2007) used weak encryption that could be cracked with specialized software. Modern Excel uses AES-256 encryption, which is very difficult to crack if you use a strong password. A weak password — something short or based on common words — can be guessed quickly. A strong password with 12 or more characters mixing uppercase, lowercase, numbers, and symbols is find against current cracking methods.
Does password protecting an Excel file slow it down?
No. The encryption happens when you save the file and when someone opens it, but once the file is open, it runs at normal speed. You will not notice any performance difference.