The fastest way: use the built-in password feature

Excel has a password tool built into the File menu on both Windows and Mac. You open the file you want to protect, go to File > Info > Protect Workbook, choose "Encrypt with Password", type your password twice, and save. That's the entire process — no third-party software needed.

When someone tries to open that file later, Excel will ask for the password before showing any data. If they don't have it, they see a locked-file dialog and cannot proceed. The password encrypts the file itself, not just a single sheet, so the whole workbook stays protected.

This method works on Excel 2016 and newer on both Windows and Mac. If you use an older version or a different spreadsheet program like Google Sheets or LibreOffice, the steps differ — those are covered in the sections below.

Key Takeaways

  • Excel's built-in encryption (File > Info > Protect Workbook > Encrypt with Password) protects the entire file and requires a password to open it at all.
  • A strong password should be at least 12 characters and mix uppercase, lowercase, numbers, and symbols — "Excel2024!" is weaker than "Tr0pic@lSunset#42".
  • If you forget the password, there is no recovery method; Excel cannot decrypt the file without it, so write it down or store it in a password manager.
  • Protecting a sheet (which only locks cells from editing) is different from protecting the file (which requires a password to open); use file protection if you want to keep the data itself hidden.
  • Google Sheets and LibreOffice use different methods — Google Sheets relies on folder sharing permissions, while LibreOffice has its own File > Save As password option.

Step-by-step for Windows Excel

Open the Excel file you want to protect. Click the File tab in the top-left corner. In the left sidebar, click Info. On the right side of the screen, you'll see a button labeled "Protect Workbook" — click it and select "Encrypt with Password" from the dropdown menu.

A dialog box will appear asking you to enter a password. Type your password in the first field. Type it again in the second field to confirm you didn't make a typo. Click OK. Excel will return you to the spreadsheet. Now save the file using Ctrl+S or File > Save. The password protection takes effect once you save.

The next time anyone opens this file, they will see a password prompt before the spreadsheet appears. Without the correct password, the file cannot be opened.

Step-by-step for Mac Excel

Open the Excel file. Click File in the menu bar at the top. Scroll down and click "Info". On the right side, look for a button that says "Protect Workbook" and click it. Select "Encrypt with Password".

A password dialog will pop up. Enter your password in the first box and re-enter it in the second box to confirm. Click OK. Then save the file using Command+S or File > Save. The protection is now active.

Mac Excel uses the same encryption method as Windows Excel, so the file will be protected whether it's opened on a Mac or Windows computer later.

Choosing a password that actually protects your file

A weak password like "123456" or "password" defeats the purpose of encryption. Someone with basic password-cracking tools can break into the file in minutes. A strong password is harder to guess and harder to crack by brute force.

Aim for at least 12 characters. Mix uppercase letters, lowercase letters, numbers, and symbols. "Tr0pic@lSunset#42" is much stronger than "Excel2024!" because it has no dictionary words and no obvious patterns. Avoid birthdays, names, or anything someone who knows you could guess.

Write the password down and store it somewhere safe — a physical notebook in a locked drawer, or a password manager like Bitwarden, 1Password, or KeePass. Do not email it to yourself or store it in a plain text file on your computer. If you forget the password, Excel cannot recover the file. There is no "forgot password" button for encrypted files.

What happens when you protect a sheet instead of the file

Excel offers two different protection options, and they do very different things. File protection (what we covered above) encrypts the entire file and requires a password just to open it. Sheet protection locks individual cells so people can view the data but cannot edit it — and it does not hide the data from view.

Sheet protection is useful if you want to let someone see a spreadsheet but prevent them from changing formulas or deleting rows. File protection is what you need if you want to keep the data itself secret. If your spreadsheet contains sensitive information like financial records, client lists, or personal details, use file protection, not sheet protection.

To protect a sheet instead, go to File > Info > Protect Sheet. This is a weaker form of protection because the data is still visible — someone just cannot edit it. Sheet protection passwords are also easier to remove than file encryption passwords.

Protecting files in Google Sheets and LibreOffice

Google Sheets does not have a built-in password encryption feature like Excel does. Instead, you control who can see and edit a file through folder and file sharing permissions. To keep a Google Sheet private, click the Share button, make sure "Restricted" is selected, and only add the email addresses of people who should have access. Anyone without that email address cannot open the file at all, even if they have the link.

LibreOffice Calc (the free spreadsheet program) does have password protection. Open your file, go to File > Save As, check the box labeled "Save with password", and click Save. You'll be prompted to enter a password twice. This encrypts the file the same way Excel does.

If you use a different spreadsheet program, check its Help menu for "password" or "encryption" to find the equivalent feature. Most modern spreadsheet tools have some form of file protection.

What to do if you forget the password

There is no recovery method. Excel does not have a "forgot password" feature for encrypted files, and Microsoft cannot unlock a file for you. The encryption is designed so that even Excel's own developers cannot break it without the password.

If you lose the password, the file becomes inaccessible. This is a trade-off: strong encryption protects your data from others, but it also locks you out if you forget the key. That's why storing the password in a password manager (rather than trying to remember it) is so important. Password managers like Bitwarden or 1Password store passwords securely and let you retrieve them whenever you need them.

If you have an older backup of the file that is not password-protected, you can use that version instead. Otherwise, the encrypted file cannot be recovered.

Frequently Asked Questions

Can someone crack an Excel password?

A weak password (like "123456" or "password") can be cracked in minutes with basic tools. A strong password with 12+ characters, mixed case, numbers, and symbols is much harder to crack — it would take years of computer time with current technology. The strength of your password matters far more than the encryption method itself.

Does password-protecting an Excel file slow it down?

No. The file opens and saves at the same speed as an unprotected file. The only difference is that Excel asks for the password before opening it. Once you enter the password, the file behaves normally.

Can I password-protect just one sheet in a workbook, not the whole file?

Yes. Go to File > Info > Protect Sheet to lock a single sheet while leaving others editable. But remember: sheet protection only prevents editing, it does not hide the data. If you want to keep data secret, use file protection instead.

What if I need to share a password-protected file with someone?

Send the file and the password through separate channels — for example, email the file and text the password, or use a password manager that lets you share credentials securely. Never include the password in the same email or message as the file itself.

Does password protection work if I save the file as a PDF or CSV?

No. If you export an Excel file to PDF or CSV format, the password protection is lost. The new file is unencrypted. Keep the original .xlsx file if you want password protection to remain in place.