Skip to content

Text Encryption and Decryption

Encrypt and decrypt text using AES-256 encryption entirely in your browser. No data sent to servers.

Text Encryption and Decryption tool

Loading...

Example

Input: Text "Meet at 7pm" with password "correct horse battery staple", then Encrypt Text

Result: A 76-character Base64 string that changes on every run; decrypting it with the same password returns "Meet at 7pm"

The password is stretched with PBKDF2 (600,000 iterations, random salt) into an AES-256-GCM key, and a random 12-byte IV makes each ciphertext unique. Salt, IV and ciphertext are Base64-encoded together.

What the Encrypted Output Contains

PartSizePurpose
Salt16 bytesMakes the key from your password unique
IV12 bytesMakes each encryption of the same text different
CiphertextSame as your text in UTF-8The encrypted message
GCM tag16 bytesDetects any change to the output
Whole outputText + 44 bytes, then Base64An 11-byte note becomes 76 characters

Taken from the tool code: salt, IV and ciphertext with tag are joined and Base64-encoded.

  1. Choose Encrypt or Decrypt with the mode buttons at the top.
  2. Enter the text to encrypt, or paste the encrypted text to decrypt.
  3. Type a strong password. The same password is needed to decrypt.
  4. Click the Encrypt or Decrypt button.
  5. Copy the result from the output area.
  6. Share the encrypted text and the password through different channels.

How AES-256 Password Encryption Works Here

This tool encrypts text with AES-256-GCM using a password you choose, and turns it back into readable text when you enter the same password. It all happens in your browser with the Web Crypto API. The protection is only as strong as your password.

Three things happen when you click Encrypt. First, PBKDF2 stretches your password into a 256-bit key using 600,000 rounds of SHA-256 and a random 16-byte salt. This slow step makes each password guess costly for an attacker. Second, AES in GCM mode encrypts the text with a random 12-byte IV, a one-time starting value, so the same message gives different output every time. Third, GCM adds a 16-byte tag that detects tampering. If anyone changes a single character, decryption fails instead of returning garbage.

The result is one Base64 string that holds the salt, the IV, the encrypted text and the tag. It is always 44 bytes longer than your text, and Base64 then makes it about a third longer again. So an 11-character note becomes 76 characters. This layout is specific to this tool, so decrypt it here or with code that reads the same format.

Use it to send a short secret, such as a Wi-Fi password or a private note, through a channel you do not fully trust. Send the password another way, for example by phone. Pick a long random password, for instance from the Password Generator. A short or common password can be guessed, however strong AES is. If you want each person to have their own key pair instead of a shared password, look at the RSA Key Pair Generator.

Sources

Frequently Asked Questions

The text is gone for good. There is no reset, no back door and no copy on any server, because the password is the only way to rebuild the key. The only option is to try passwords you might have used. Keep the password in a password manager, and keep the original text somewhere safe if you still need it.
The cipher is not the weak point; the password is. An attacker with your ciphertext will try likely passwords one by one. The 600,000 PBKDF2 rounds make each guess slow, but a common or short password will still fall. A random password of 16 or more characters puts the text out of practical reach.
Each run picks a new random salt and a new random IV. The salt changes the key made from your password, and the IV changes how AES starts. So identical messages never produce identical ciphertext, which stops an observer from spotting repeats. Every version still decrypts to the same text with the right password.
Usually the encrypted text was changed in transit. A missing character at the end, a line break added by an email client, or a swapped letter makes the GCM tag check fail. Copy the full string again and paste it as one line. Also check the password for a trailing space, a different keyboard layout or a capital letter.
Not directly. The output is Base64 of a 16-byte salt, a 12-byte IV, then the AES-GCM ciphertext with its 16-byte tag, using a PBKDF2-SHA256 key with 600,000 rounds. A developer can decrypt that with a few lines of code in most languages, but common apps and the openssl enc command expect other formats.

Related Tools

Hash Generator

Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text or files right in your browser.

Developer Tools

Password Generator

Generate strong, secure passwords with customizable length, character types, and multi-word passphrases.

Security and Encryption

RSA Key Pair Generator

Generate RSA public and private key pairs in PEM format using the Web Crypto API in your browser.

Security and Encryption

HMAC Generator

Generate HMAC signatures using SHA-256, SHA-384, or SHA-512 with custom secret keys for message authentication.

Security and Encryption

Base64 Encode and Decode

Encode text to Base64 and decode Base64 strings back to readable text, with full UTF-8 support.

Developer Tools

String Obfuscator

Obfuscate text using ROT13, Base64 encoding, Unicode lookalike characters, or zero-width character insertion.

Text and Writing