Yes, you can encrypt a text file in Windows, but not with Notepad: a plain .txt file has no password feature of its own. Instead, you encrypt the file at the Windows level, or you encrypt the text itself with another tool. You may also find this useful: How to Encrypt a File with a Password: 3 Methods Compared.
Windows offers file encryption through the file’s properties, and Microsoft’s guide covers both Windows 11 and Windows 10. [1] That route is the quickest, though it protects the file through your Windows account rather than a password you type each time.
If you need a password that travels with the content, other tools can scramble the text itself. This article walks through the built-in option, then a password-based option in the Vim editor, then a simple paste-and-encrypt tool, and ends by helping you choose.
Key takeaways
Notepad cannot password-protect a .txt file.
Windows can encrypt the file from its properties. [1]
Other tools encrypt the text itself with a password.
What should you know before you start?
Before you pick a method, know that Windows’ built-in encryption protects a file for your Windows account, not with a password you can hand to someone else. Anyone who signs in to your account can open the file as normal, while other accounts cannot. If you need to share a protected file with a colleague, this is the wrong tool.
Windows 11 and 10
Microsoft’s guide to encrypting a file or folder applies to both Windows 11 and Windows 10. [1] The Properties steps are the same on both, so you do not need separate instructions. Windows 10 is past end of support, so it no longer receives regular security updates, which is a good reason to plan a move to Windows 11.
Choose a method
You have three realistic routes for a plain .txt file:
Built-in Windows encryption: the quickest option. It uses the file’s Properties and ties access to your account.
A text editor with encryption: an editor such as Vim can encrypt the file’s contents and ask for a password each time you open it.
A text-encryption tool: you paste the text into the tool, encrypt it, and save the result.
A simple way to decide is to ask who needs to open the file. If it is only you, on your own PC, the built-in option is enough. If the file will travel to another person or another computer, a password-based method fits better.
The next sections walk through each route in order, starting with the built-in one.
How do you encrypt a text file with Windows built-in encryption?
You can encrypt a .txt file with Windows’ built-in file encryption in a few clicks from the file’s Properties window. The steps below follow Microsoft’s guide, which applies to Windows 11 and Windows 10. [1]
Right-click the .txt file in File Explorer and select Properties. [1]
On the General tab, click Advanced.
Tick the Encrypt contents to secure data check box. [2]
Click OK in the Advanced Attributes window, then OK again in Properties.
If Windows asks what to encrypt, choose Encrypt the file and its parent folder if you want everything in that folder protected, or encrypt only the file. [2]
Wait for the window to close. The file is now encrypted.
For example, if notes.txt sits in a folder called Journal, encrypting the file and its parent folder also covers any text files you add to Journal later. Encrypting only the file leaves the rest of the folder untouched.
Encrypted files may be displayed with green text in File Explorer, which is a quick way to see which files are protected. [2]
Back up first
Before you encrypt, copy the .txt file to a safe place such as a USB drive. Also back up your encryption key, using a strong password to protect that backup. [2] If you lose the key, you lose access to the file, so keep the key backup and the plain copy somewhere separate from the encrypted original. For the next step, see How to Password Protect a File in Windows 11.
Can you encrypt the text itself with Vim?
Yes. If you have Vim installed, it can encrypt the text inside a file and protect it with a password, so the content is scrambled on disk rather than just tied to your Windows account. [3]
Open a terminal or command prompt where Vim is installed.
Create the file with the
-xoption:
vim -x some-text-file.txt
The -x option tells Vim to encrypt the file, and some-text-file.txt is the file name you want to create. [3]
Enter a password when Vim asks for one. Vim uses it to decrypt the file later. [4]
Type your text, then save and close the file as you normally would in Vim.
To read the file again, open it with Vim and enter the same password.
Remember the password. Without it you cannot decrypt the file, and you cannot open it at all. [3]
What the saved file looks like
If you display the saved file without the password, for example with cat, you see scrambled characters instead of your words. The file begins with the marker VimCrypt, followed by unreadable text. [3]
If you open it in Vim and enter the wrong password, you also get unreadable output rather than your text. [4]
A practical example: a file holding a few account notes, saved this way, shows only VimCrypt and garbled characters to anyone who opens it in another editor or prints it.
Is there a simple tool for pasting text and encrypting it?
Yes. SmartTextCrypter lets you paste text into a window, encrypt it, and save the result. It works for plain-text formats such as .txt, .csv, .md, and .json files. [5]
How it works
Open the
.txtfile in Notepad and copy its content.Open SmartTextCrypter and paste the content into it.
Encrypt the text, then save the result. [5]
After saving, the encrypted copy is the one to share or store. Keep in mind that the original .txt file is still readable until you delete it yourself.
The steps are manual. You paste and save each time, so this suits a few files rather than a whole folder of notes.
When this approach makes sense
Use a tool like this when you want protection that depends on a password you choose, rather than on your Windows account. For example, say you want to email a list of account notes to a coworker. The built-in Windows encryption would tie the file to your own sign-in, but an encrypted copy made from pasted text can be opened by anyone you give the password to.
It also helps when the file will leave your PC, such as on a USB drive or in cloud storage, because the protection travels with the content itself.
The tool’s own documentation covers the exact buttons and options for encrypting and saving, so follow the on-screen labels in the version you have installed.
Which method should you choose?
Pick the built-in option if you only need to keep other Windows users out, Vim if you want a real password, and a text crypter if you want to paste and save without installing an editor.
Criteria | Built-in Windows encryption | Vim | Text crypter (SmartTextCrypter) |
|---|---|---|---|
Protection tied to | Your Windows account | A password you set | Whatever the tool asks for |
Setup | Nothing to install; uses file Properties | Vim must be installed | A separate tool to install |
Effort per file | Tick one option once | Run | Paste the content and save, each time |
Works on | Windows only | Any system with Vim | The tool’s output file |
How the options differ
The built-in method is the easiest because it uses the file’s Properties on both Windows 11 and Windows 10. [1] The trade-off is that it is account-bound and Windows only, so it is not a password you can hand to someone else.
Vim is password-based. You create the file with vim -x some-text-file.txt, and Vim asks for a password to decrypt it later. [4] It only works if Vim is installed, and if you forget the password you cannot open the file. [4]
A text crypter such as SmartTextCrypter suits a quick job: paste the file’s content into the tool and then save the result. [5] That manual step repeats every time you change the text, which makes it better for occasional notes than for a file you edit daily.
For a personal laptop that only you sign in to, the built-in route is usually enough. If the file will travel to another person or computer, choose one of the password-based options.
What is the safest way to wrap up?
Pick the method based on who needs to open the file. If only you use this Windows account, built-in encryption is enough. If you need to share the file or open it on another computer, use a password-based method such as Vim or a text crypter.
Before you rely on any of them, store a recovery copy of the encryption key or password somewhere separate from the file, such as a USB drive kept in a safe place. Microsoft’s guide covers backing up the key for built-in encryption, and without it you can lose access to your own file. [1] Your next step: choose one method, encrypt a copy of a test file, and open it again before you protect anything important.
