Free tool · Security and privacy
Encrypt text online
To encrypt text online, type the message and a passphrase and press Encrypt: the text is locked with AES-256-GCM using a key made from the passphrase, and only someone with the same passphrase can turn it back into the message here. Everything runs in your browser, so neither the text nor the passphrase leaves your device.
- Free
- No sign-up
- Runs in your browser
ReadyType a message and a passphrase, then press Encrypt. The key is stretched 600,000 times, so a slow phone may take a moment.
- AES-256-GCM
- PBKDF2-SHA-256, 600,000 rounds
- Runs on your device
How to use the Text Encryption Tool
- Keep Encrypt selected, type or paste the message into Text to encrypt.
- Type a long Passphrase, such as four random words, and press Encrypt.
- Copy the encrypted block or download it as a .txt file, and send the passphrase to the reader another way.
- To read a block, choose Decrypt, paste it, type the passphrase and press Decrypt.
How does this text encryption work?
Two standard steps, both done by your browser's built-in Web Crypto functions. First the passphrase is turned into a 256-bit key with PBKDF2-HMAC-SHA-256, run 600,000 times over the passphrase and a random 16-byte salt. 600,000 is the iteration count the OWASP Password Storage Cheat Sheet recommends for PBKDF2 with SHA-256; the repetition makes every passphrase guess slow for an attacker, and the salt makes each block need its own work.
Then the text is encrypted with AES in Galois/Counter Mode (GCM), using that key and a random 12-byte starting value (IV). NIST describes GCM, in SP 800-38D, as authenticated encryption, and MDN notes that GCM includes checks that the ciphertext has not been modified, which is why it is often recommended over the other AES modes. In practice that means a wrong passphrase, or a block with even one character changed, is refused instead of producing garbage.
The result is one line of Base64: a version byte, the iteration count, the salt, the IV, then the encrypted text with its 16-byte check tag. Everything needed to decrypt it is inside the block except the passphrase.
Can I try it with an example?
Yes. The block below is the message "Meet at the north gate at 6." encrypted on this page with the passphrase "correct horse battery staple". Choose Decrypt, paste the block and type the passphrase, and you get the message back. Change one letter of the passphrase and you get an error instead.
AQAJJ8ABAgMEBQYHCAkKCwwNDg8QZGVmZ2hpamtsbW5vOHmqdjx2DKeZRwWHLoorlxBuB5hEX1kGq22iBUgu5H7eWoxeymJ+HgTQMFg=
This sample was made with a fixed salt and IV so it stays the same on the page. When you press Encrypt, both are drawn at random every time, so encrypting the same message twice gives two different blocks, and nobody can tell that two blocks hold the same text.
How long is the encrypted text?
It is the message plus 49 bytes of header and check tag, written in Base64, which uses 4 characters for every 3 bytes. Text is counted in UTF-8 bytes, so an accented letter takes 2 bytes and most emoji take 4. The table shows the sizes for a few message lengths, computed by the same code the page uses.
| Message (UTF-8) | Encrypted bytes | Base64 block |
|---|---|---|
| 1 bytes | 50 bytes | 68 characters |
| 28 bytes | 77 bytes | 104 characters |
| 280 bytes | 329 bytes | 440 characters |
| 1,000 bytes | 1,049 bytes | 1,400 characters |
| 10,000 bytes | 10,049 bytes | 13,400 characters |
For short messages the fixed overhead dominates: one byte of text becomes a 68-character block. For long ones the block is about a third larger than the text. Base64 uses only letters, digits, + and /, so the block survives email, chat apps and text fields that would break raw binary data.
Is it safe to encrypt text online?
With this page, the text and the passphrase never leave your device: the encryption runs in the page with the browser's own cryptography, and nothing is sent or stored. You can check this by loading the page, turning off your network connection and encrypting; it still works.
The weak point is the passphrase. Anyone who gets the block can try passphrases on their own computer as fast as their hardware allows, and the key stretching only slows them down. A short or common passphrase can be guessed; four or more random words, or a long random password from the passphrase generator, cannot in practice. The page warns when a passphrase is under 12 characters, and the password strength checker estimates how guessable a passphrase is.
Encryption also does not hide everything. Someone who sees the block can tell roughly how long the message is, from the table above, and who sent it to whom. If the length itself gives something away, add some extra text to the message before you encrypt it.
Send the passphrase by a different route than the block, for example by phone if the block goes by email. There is no recovery: if the passphrase is lost, the text cannot be decrypted by anyone, including this page.
Is encryption the same as encoding or hashing?
No. Encoding, such as Base64, changes how data is written so it travels safely, and anyone can reverse it without a key; the Base64 decoder does exactly that. Hashing, such as SHA-256, turns data into a fixed-length fingerprint that cannot be turned back into the data at all, which suits checking files and storing passwords. Encryption is the one that hides data and can be reversed, but only with the key.
A quick way to tell them apart: if you can undo it without knowing a secret, it is encoding; if you can never undo it, it is hashing; if you can undo it only with the secret, it is encryption. Text that looks like random letters and digits is not necessarily encrypted. It is often just Base64, which anyone can read back.
This tool uses all three ideas: a hash function inside PBKDF2 to make the key, AES-GCM to encrypt, and Base64 to write the result as text. A Caesar cipher, by contrast, is a puzzle, not protection: it has only 25 possible keys and can be broken by hand.
Use it with
- Caesar Cipher: encode and decode text by shifting letters.
- Base64 Encoder Decoder: encode or decode Base64.
- Hash Generator: MD5, SHA-1, SHA-256 of text or files.
Questions
How do I encrypt a text message with a password?
Type the message, type a long passphrase and press Encrypt. Send the encrypted block to the reader and the passphrase separately; they decrypt it on this page.
What encryption does this tool use?
AES-256 in GCM mode, with the key derived from your passphrase by PBKDF2-HMAC-SHA-256 with 600,000 iterations and a random salt.
Can encrypted text be decrypted without the password?
Not in practice, if the passphrase is long and random: the only way in is to guess it. A short or common passphrase can be guessed, so use four or more random words.
Is my text sent to a server?
No. Encryption and decryption run in your browser with its built-in cryptography. Nothing is uploaded or stored.
What happens if I forget the passphrase?
The text cannot be recovered. There is no reset and no copy of the key anywhere.
Why does the same text give a different result each time?
Each encryption uses a new random salt and IV. That hides whether two blocks contain the same message; both still decrypt with the right passphrase.
Sources
How this page was made: the tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations were drafted with AI help and checked against the tool's own output.