AES Text Encryption and Decryption
Online AES-GCM text encryption and decryption tool. Enter text and a key of at least 8 characters to encrypt, then decrypt with the same key. Built on the browser's native Web Crypto API and computed entirely locally.
FreeOnline Tool
Loading…
How to Use
- Put the text you want to encrypt (or the ciphertext you want to decrypt) into the input box
- Enter a key of at least 8 characters. The same key must be used for both encryption and decryption
- Click encrypt to obtain the ciphertext. Paste that ciphertext together with the same key into the decryption area to recover the original text
- If the key is wrong or the ciphertext has been altered, decryption fails with an error instead of returning garbled text
Features
- Uses AES-GCM symmetric encryption through the browser's native Web Crypto API (crypto.subtle), so no plaintext is sent to any third party
- The key is hashed to derive the actual encryption key, and must be at least 8 characters long
- A random initialisation vector (IV) is generated for every encryption, so the same plaintext and key produce different ciphertext each time
- AES-GCM is an authenticated encryption mode, so decryption verifies integrity and rejects tampered ciphertext rather than returning incorrect plaintext
- All computation happens locally in the browser and nothing is uploaded to a server
Use Cases
Sending sensitive text safely
Encrypt text containing sensitive information before sending it through chat or email, and let the recipient decrypt it with an agreed key.
Learning AES and the Web Crypto API
Work through real encrypt and decrypt operations to build an intuition for keys, ciphertext and initialisation vectors.
Checking your own encryption logic
While building an AES-based feature, use this tool to confirm that a key and ciphertext behave the way you expect.
Producing sample encrypted test data
Quickly generate valid ciphertext samples for test scenarios that require encrypted fields.
FAQ
Which encryption algorithm does this use?
AES-GCM (Galois/Counter Mode), a modern authenticated-encryption mode that provides both confidentiality and integrity checking, implemented through the browser's native Web Crypto API.
Why does encrypting the same text with the same key give different ciphertext each time?
That is expected. AES-GCM generates a random initialisation vector (IV) for each encryption and stores it alongside the ciphertext. A different IV yields different ciphertext even for identical input, which is standard practice for security and does not prevent correct decryption with the same key.
Why does decryption fail with an error?
Usually the key is wrong, or the ciphertext was truncated or altered while being copied or transmitted, so the integrity check fails. Because AES-GCM is authenticated, it refuses to decrypt data that fails verification rather than returning incorrect plaintext.
Are there requirements for the key length?
The key must be at least 8 characters, and it is hashed to derive the real encryption key. Longer and more random keys are stronger, so prefer a complex passphrase over a short simple one.