Blog
Wild & Free Tools

How to Password Protect a Text File on Windows, Mac, or Online

Last updated: April 2026 8 min read

Table of Contents

  1. Windows: Built-In Options
  2. Mac: Built-In Options
  3. Online Method: Browser-Based Encryption
  4. Comparing the Security Levels
  5. What NOT to Do
  6. Frequently Asked Questions
You've got sensitive text in a .txt file — maybe a list of passwords, private notes, login credentials, or confidential information. You want to lock it so only you (or someone you trust) can open it. This guide covers every realistic option: Windows built-in tools, Mac native methods, third-party software, and browser-based encryption — ranked by ease of use and actual security level.

How to Password Protect a Text File on Windows

Option 1: Encrypt the containing folder (Windows Pro/Enterprise only)

Right-click the folder → Properties → Advanced → "Encrypt contents to secure data." This uses Windows EFS (Encrypting File System). The file is encrypted for your Windows user account. Anyone logged into your account can still open it — this protects against someone physically removing the drive, not against someone who has your Windows password.

Option 2: 7-Zip with AES-256

  1. Download 7-Zip (free, open source) at 7-zip.org
  2. Right-click your .txt file → 7-Zip → Add to archive
  3. Set Encryption method to AES-256
  4. Enter a password in the "Enter password" fields
  5. Check "Encrypt file names" for additional privacy
  6. Click OK

You get a .7z archive. The original .txt file should be deleted securely afterward (use Eraser or shift+delete is not enough for a truly sensitive file). To open, double-click the .7z and enter the password.

Option 3: Microsoft Word/Office

Paste your text into a Word document. File → Info → Protect Document → Encrypt with Password. Not a .txt file anymore, but it's a simple built-in option for users already in the Microsoft ecosystem.

How to Password Protect a Text File on Mac

Option 1: Disk Utility — Encrypted DMG

  1. Open Disk Utility (Applications → Utilities → Disk Utility)
  2. File → New Image → Image from Folder
  3. Select the folder containing your text file
  4. Set Encryption to "128-bit AES" or "256-bit AES"
  5. Enter a password when prompted
  6. Click Save

This creates a .dmg file that requires the password to mount. Strong and native, but you're encrypting a folder, not the file directly.

Option 2: TextEdit + Password-Protected Note in Notes App

Notes app on Mac allows password-protected notes (File → Lock Note). This is easy but ties you to the Notes app and iCloud sync.

Option 3: Terminal with openssl

openssl enc -aes-256-cbc -salt -pbkdf2 -in secret.txt -out secret.txt.enc

Enter a password when prompted. To decrypt:

openssl enc -aes-256-cbc -d -pbkdf2 -in secret.txt.enc -out secret.txt

Powerful but requires comfort with the command line. The -pbkdf2 flag is important — always include it for proper key derivation.

Sell Custom Apparel — We Handle Printing & Free Shipping

How to Password Protect Text Without Software (Browser-Based)

If you don't want to install software or if you're on a shared computer, browser-based AES-256 encryption is the fastest option:

  1. Open a browser-based text encryption tool
  2. Paste the contents of your text file into the Encrypt panel
  3. Enter a strong password
  4. Copy the encrypted output
  5. Save the cipher string to a new .txt file

The resulting file looks like random base64 text. Anyone who opens it without the password sees gibberish. To recover the original text, paste the cipher string into the Decrypt panel and enter the password.

Advantages over software methods:

Security Comparison: Which Method Is Actually Safest?

MethodEncryptionThreats Protected Against
Windows EFSAES-256Physical drive theft only
7-Zip AES-256AES-256Drive theft + unauthorized file access
Mac Disk Utility DMGAES-256Drive theft + unauthorized file access
openssl encAES-256Drive theft + unauthorized file access
Browser-based encryptionAES-256-GCMDrive theft + file sharing + transmission
MS Word passwordAES-128/256Drive theft + unauthorized file access

All AES-256 methods are cryptographically equivalent — the algorithm is the same. The difference is what threats they protect against. Browser-based encryption adds the unique ability to transmit the cipher safely across any channel without special software on the receiving end.

Common Mistakes When Password Protecting Text Files

Password Protect Your Text — Free, No Software Needed

Paste your text, set a password, get AES-256 encrypted output. Works in any browser on Windows, Mac, Linux, or mobile.

Open Free Text Encryption Tool

Frequently Asked Questions

Can I password protect a .txt file directly in Notepad?

No, Notepad has no built-in encryption. Your options are: 7-Zip (encrypt the file), browser-based text encryption (encrypt the contents), or Disk Utility on Mac. There is no native "lock .txt file" feature in Windows Notepad.

Is a password-protected Word document actually secure?

Modern versions of Word (2007+) use AES-128 or AES-256. Older versions (pre-2003) used weak RC4 that can be cracked easily. For a modern .docx file with a strong password, the encryption is solid.

How do I share an encrypted text file with someone who doesn't have 7-Zip?

Either share the 7-Zip installer alongside the file, use browser-based text encryption (they just need a browser), or use PrivateBin/similar tools that allow encrypted sharing via URL.

Does encrypting a text file change its size significantly?

Slightly. AES-256 output is typically 1.3-1.5× the size of the plaintext for typical text content (due to base64 encoding). For text files, this is usually negligible.

Launch Your Own Clothing Brand — No Inventory, No Risk