Skip to content

Encrypt Text with a Password (AES-256-GCM)

Turn a private note, API key or message into ciphertext that only your password can open. Encryption uses AES-256-GCM through your browser's Web Crypto API, and nothing is sent to a server.

Action Overview
Current Action Encrypt text locally
Password Status Waiting for password
Input Detection Plain or unknown text
Security Method AES-GCM • PBKDF2-SHA-256
Password strength: Waiting
Ready status
Add a password to see whether it is weak, fair, good, or strong.
Text is encrypted and decrypted in your browser. Nothing is uploaded.

Encryption Controls

Choose the action, output format and key strength.

Ready to process
600k
Ready. Paste text, enter a password, and choose encrypt or decrypt.
ModeEncrypt
Password StrengthWaiting
Iterations600,000
Input Size0 chars
Output Size0 chars
StatusReady

Input and output

Paste text or an encrypted token on the left. The result appears on the right.

No result yet Metadata waiting

Input Text

Plain / Encrypted 0 chars
Ready
Auto detect waiting

Output Result

No output 0 chars

Waiting
Nothing copied yet

Result Analysis

The detected format and the settings stored in the encrypted text.

Waiting
Detected Format—
AlgorithmAES-GCM
Salt—
IV / Nonce—
Iterations—
AdvicePaste text and process it to see useful metadata.

Useful notes

What this tool does and how to use it correctly.

  • Encrypt mode protects plain text and creates an encrypted token or JSON envelope.
  • Decrypt mode reads the encrypted token or JSON and unlocks the original plain text.
  • Compact Token is cleaner for sharing or storing in one line.
  • Readable JSON is better when you want inspectable metadata.

Runs in your browser. Nothing you type, paste or open here is uploaded.

To encrypt text, paste it into Input Text, enter a password in Password and again in Confirm Password, then select Encrypt. The tool derives a 256-bit key from your password with PBKDF2 and encrypts the text with AES-GCM in your browser. Copy the token from Output Result; paste it back with the same password and select Decrypt to read it.

How to encrypt text with a password

  1. Add your text. Paste it into Input Text or use Load text file for a .txt, .json, .md, .log or .enc file.
  2. Set a password. Type it in Password and Confirm Password. A long passphrase works best; the strength bar gives a rough rating.
  3. Pick output and iterations. Choose Compact token or Readable JSON under Encrypt Output Format. PBKDF2 iterations starts at 600k, the OWASP recommendation; slide it higher for more protection against password guessing, or lower only for a slow device.
  4. Encrypt, then share or store. Select Encrypt and copy or download the output. To read it later, paste it in, enter the same password and select Decrypt.

How this text encryption works

Every encryption runs entirely in your browser through the Web Crypto API:

  1. A random 16-byte salt and a random 12-byte IV (nonce) are created with crypto.getRandomValues().
  2. PBKDF2 with HMAC-SHA256 stretches your password and the salt into a 256-bit AES key, running 600,000 iterations by default.
  3. AES-256 in GCM mode encrypts the UTF-8 text. GCM also adds a 16-byte authentication tag, so any change to the ciphertext, or a wrong password, makes decryption fail instead of returning garbage.

A 12-byte (96-bit) IV is the length the AES-GCM specification recommends, and because salt and IV are fresh each time, encrypting the same text twice with the same password gives different output. The salt, IV and iteration count are stored in the output in plain view so decryption can repeat the same steps, which is safe because they don't need to be kept secret.

AES encryption online: what the output contains

Compact Token gives one line starting with TLABENC.v1., followed by base64url-encoded JSON. Readable JSON shows the same fields directly:

{
  "v": 1,
  "alg": "AES-GCM",
  "kdf": "PBKDF2-SHA-256",
  "iterations": 600000,
  "salt": "...16 bytes, base64url...",
  "iv": "...12 bytes, base64url...",
  "ciphertext": "...ciphertext + tag, base64url...",
  "createdAt": "2026-10-11T09:30:00.000Z"
}

The format uses standard algorithms, so you can decrypt it without ToolzyLab. In Python with the cryptography package:

import base64, json, hashlib
from cryptography.hazmat.primitives.ciphers.aead import AESGCM

def b64u(s): return base64.urlsafe_b64decode(s + '=' * (-len(s) % 4))

p = json.loads(b64u(token.removeprefix('TLABENC.v1.')))
key = hashlib.pbkdf2_hmac('sha256', password.encode(), b64u(p['salt']), p['iterations'], 32)
print(AESGCM(key).decrypt(b64u(p['iv']), b64u(p['ciphertext']), None).decode())

Note that createdAt is readable by anyone who has the token, as is the iteration count.

How strong is it, and how to choose a password

AES-256-GCM itself isn't the weak point. Anyone who gets your token can try passwords offline as fast as their hardware allows, so the password decides how safe the text is. PBKDF2 slows each guess down: the OWASP Password Storage Cheat Sheet recommends 600,000 iterations for PBKDF2-HMAC-SHA256, and that is the default here. The slider goes from 100,000 to 2,000,000. The iteration count is saved in the token, so decryption picks it up automatically; to stop a crafted token from freezing the page, the tool refuses tokens that ask for more than 5,000,000 iterations.

Use a long, random password or a passphrase of several unrelated words, and send it through a different channel from the token, for example the token by email and the password by phone. The strong password generator can create one. There's no recovery: if you forget the password, the text can't be decrypted by you, ToolzyLab or anyone else.

How to decrypt text

Paste the token or JSON into Input Text. With Auto-detect encrypted input ticked, the tool spots the TLABENC.v1. prefix or the JSON fields and switches Action to Decrypt text. Enter the password, then select Decrypt or Run. Confirm Password isn't needed for decrypting.

"Decryption failed. Wrong password or corrupted encrypted text." means the GCM check rejected it: the password is wrong, or the token was cut off or edited, often by a chat app wrapping long lines. Copy the full token again. Swap input and output moves a result back to the input, which is handy for checking that a fresh token decrypts before you send it.

Trim outer whitespace is on by default, so leading and trailing spaces and line breaks are removed before encryption. Untick it if they matter. This tool is for encrypting text; a hash is one-way and can't be reversed, which the hash generator page explains.

Frequently asked questions

Is it safe to encrypt text online here?

The text and password never leave your browser: encryption runs locally with the Web Crypto API and nothing is uploaded or stored. The result is as safe as your password is hard to guess.

What encryption does this tool use?

AES-256 in GCM mode, with the key derived from your password by PBKDF2-HMAC-SHA256 using a random 16-byte salt. Each encryption also uses a random 12-byte IV.

Can I decrypt text without the password?

No. There's no backdoor or recovery option. Without the exact password, including capital letters and spaces, the text can't be decrypted.

Why does the same text give a different result each time?

A new random salt and IV are generated for every encryption. That's intentional: it stops anyone from telling that two tokens contain the same message.

Can other tools decrypt the output?

Yes, if they implement PBKDF2-HMAC-SHA256 and AES-256-GCM with the stored salt, IV and iteration count. The Python example on this page shows how.

How many PBKDF2 iterations should I use?

Use 600,000, the OWASP recommendation for PBKDF2-HMAC-SHA256, unless the device doing the decrypting is slow. Higher counts make each password guess more expensive for an attacker.

Updated 11 October 2026Reviewed by the ToolzyLab teamHow we test our tools