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
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
| Part | Size | Purpose |
|---|---|---|
| Salt | 16 bytes | Makes the key from your password unique |
| IV | 12 bytes | Makes each encryption of the same text different |
| Ciphertext | Same as your text in UTF-8 | The encrypted message |
| GCM tag | 16 bytes | Detects any change to the output |
| Whole output | Text + 44 bytes, then Base64 | An 11-byte note becomes 76 characters |
Taken from the tool code: salt, IV and ciphertext with tag are joined and Base64-encoded.
- Choose Encrypt or Decrypt with the mode buttons at the top.
- Enter the text to encrypt, or paste the encrypted text to decrypt.
- Type a strong password. The same password is needed to decrypt.
- Click the Encrypt or Decrypt button.
- Copy the result from the output area.
- 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
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 ToolsPassword Generator
Generate strong, secure passwords with customizable length, character types, and multi-word passphrases.
Security and EncryptionRSA Key Pair Generator
Generate RSA public and private key pairs in PEM format using the Web Crypto API in your browser.
Security and EncryptionHMAC Generator
Generate HMAC signatures using SHA-256, SHA-384, or SHA-512 with custom secret keys for message authentication.
Security and Encryption