How to Password Protect a Text File

You might overlook text files on your computer, but if you have one with sensitive data, you can password protect a text file.

When you have important documents with sensitive information, you can password-protect Office files with built-in features. However, if you have a file created in Notepad or other text editors, you need a third-party app to password-protect a text file.

If you don’t secure a text file, the content is in plain text and can be viewed by anyone. However, since Windows doesn’t have a native tool to password-protect text files, you can use a free and open-source utility like 7-Zip or WinRAR.

So, in this guide, we’ll show you how to encrypt and password-protect a text file on your Windows PC.

How to Password Protect a Text File with 7-Zip

There are many situations when you need to password-protect a text file. For example, sensitive company data exported from Excel spreadsheets to a text file need securing. Or, perhaps you have essential code created in a text editor you want to protect. Whatever the reason, the steps to password-protect a text file are straightforward.

For this article, we’re using 7-Zip on Windows, but other third-party archiving apps include the ability to password-protect zip files. The steps will vary, but the concept is the same.

Also, it’s important to note that once you create the password-protected zip file, any archiving app can manage it, i.e., WinRAR or WinZip.

To password-protect a text file:

  1. Download and install 7-Zip if you don’t have it already.
  2. Launch File Explorer and navigate to the location of the text file you want to protect.
  3. Right-click the text file and select 7-Zip > Add to archive from the context menu.

Password Protect a Text File

  1. On the Add to Archive screen, select the Enter Password box under the Encryption section, type a strong password twice, and click OK.

  1. Your password-protected file will be in the same folder as the plain text file.

  1. The only way to open it is to type in the correct password.

Password Protect a Text File

How to Open a Password-Protected Text File

The text file is protected in the archive you made for it. You can use any archiving tool to open it, but the password you created for the file must be used.

To open a password-protected text file:

  1. Open File Explorer and navigate to the location of the password-protected file.
  2. Right-click the file and choose 7-Zip > Open Archive.
    NOTE: If 7-Zip is the default Windows archiving app, double-click the file.

Password Protect a Text File

  1. The file will display in 7-Zip (or another utility). Remember, the person can see the file’s title, so label it accordingly.

  1. Double-click the file to extract it.
  2. To open the text file and view the file’s content, the app will display a box asking for the password.

Password Protect a Text File

It’s also important to note that once you password-protect a text file, the original unprotected plain text file will still be on your computer. So, securely delete that version of the file to prevent unauthorized access.

How to Disable Password Protection on a Text File

If you need to remove password protection from the text file, you can. This will remove encryption and password protection for the file. The straightforward process lets you access it without typing in a password first.

To disable text file password protection:

  1. Launch File Explorer and navigate to the location of the archived text file.
  2. Right-click the archive and select 7-Zip > Extract Here from the menu. Alternatively, you can drag and drop the file to another folder or the desktop.

Password Protect a Text File

  1. Type in the password assigned to the file.

  1. The text file will be extracted to the same folder, and you can now access it without a password.

Password Protect a Text File

If you need to re-add password protection again, use the steps explained above to add encryption and a password to the file.

Lock Down Your Important Documents on Windows

You will have sensitive information in a text file in many instances. And if it isn’t secure, anyone with access to that file can open and read its content. So, it’s a best practice to encrypt the file with a password.

There are other situations where you need to password-protect different file types. For example, you might want to learn to encrypt and password-protect files and folders on Windows 11. Or, check out how to password-protect Outlook PST files.

Or, in addition to Office documents, you can encrypt a PDF with a password on Windows and Mac. And, to keep folders secure, check out how to lock a folder on Windows 11. Also, if you aren’t on Windows 11 yet, learn about encrypting files and folders on Windows 10 using its built-in EFS technology.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *


To Top