AES Encrypt / Decrypt
Input
Files always use AES-GCM, whatever mode is selected for text.
Output
Your result will appear here
Enter your data, review the configuration, then run the encryption or decryption.
Advanced
Authenticated encryption with additional data — recommended for most use cases.
12 bytes (96-bit nonce) · Use a unique IV for every encryption with the same key.
PBKDF2 key derivation
Default is 600,000 iterations (OWASP guidance for PBKDF2-HMAC-SHA256). Lower values derive faster but are easier to brute-force.
Security notes
AES-GCM provides both encryption and authentication — it can detect tampering. CBC and CTR provide confidentiality only; integrity must be verified separately. ECB is deterministic and leaks patterns — avoid it.
A unique IV must be used for every encryption with the same key. Reusing an IV with GCM can completely break security. This tool auto-generates a cryptographically random IV.
PBKDF2 derives a cryptographic key from your passphrase using a random salt and many iterations, making brute-force attacks expensive. To decrypt later you need the same passphrase plus the salt and iteration count — the tm1 bundle already stores the salt and iterations for you.
Overview
AES-256 encryption and decryption online — GCM, CBC, OpenSSL and CryptoJS
Encrypt and decrypt text or files with AES-GCM, CBC, CTR, or ECB. Use a passphrase (PBKDF2, 600,000 iterations by default) or a raw key, switch to an OpenSSL or CryptoJS preset to read existing ciphertext, and keep everything in your browser — keys, IVs, and plaintext never leave your device.
Guide
How to Use
- 1 Choose your encryption mode
The tool defaults to AES-GCM, which provides both encryption and authentication. Switch to CBC, CTR, or ECB if your use case requires it.
- 2 Enter your passphrase or key
Type a passphrase and the tool derives an AES key with PBKDF2. Or switch to Hex / Base64 format and paste a raw key of the exact required length.
- 3 Enter the text to encrypt or decrypt
Paste or type your message into the input area. For decryption, paste the ciphertext in the format it was produced (Base64 or Hex).
- 4 Click Encrypt or Decrypt
All processing happens in your browser — your data never leaves your device. The result appears instantly in the Output panel on the right.
- 5 Copy your results
Use the copy button next to each output field, or copy the tm1 bundle, which packs the ciphertext, IV, auth tag (GCM), and salt (passphrase) into one string. Without the bundle you need every one of those values to decrypt later.
Reference
AES Mode Comparison
| Mode | Security | Authentication | Padding | IV bytes |
|---|---|---|---|---|
| AES-GCM | Recommended | Yes (AEAD) | None needed | 12 |
| AES-CBC | Acceptable | No | PKCS7 | 16 |
| AES-CTR | Acceptable | No | None needed | 16 |
| AES-ECB | Not recommended | No | PKCS7 | None |
Reference
Compatibility with OpenSSL, CryptoJS, and other languages
AES is a standard, so ciphertext made here can be read elsewhere — as long as every parameter matches. Pick a preset to load the matching defaults.
- OpenSSL (enc)
The OpenSSL preset targets the "Salted__" format of openssl enc -aes-256-cbc -pbkdf2 -a. Match the iteration count and digest used on the command line (OpenSSL defaults to 10,000 iterations with SHA-256).
- CryptoJS
The CryptoJS preset decrypts strings that start with U2FsdGVkX1 — the Base64 of "Salted__" — produced by CryptoJS.AES.encrypt(text, passphrase). Legacy CryptoJS derives its key with MD5-based EVP_BytesToKey, which is weaker than PBKDF2; use it only to read existing data.
- Web Crypto, Node.js, Python, Java
With a raw key, a known IV, and AES-GCM, the output interoperates with crypto.subtle, Node.js crypto, Python cryptography, and Java javax.crypto. Some libraries expect the auth tag appended to the ciphertext — this tool shows it separately. Use the code snippet panel to copy a matching example.
- tm1 bundle
The tm1 bundle is a Tool Matic format for moving a message between two people who both use this page. For other software, copy the ciphertext, IV, tag, and salt separately.
Guide
Troubleshooting decryption errors
- Authentication tag verification failed (GCM)
The key or passphrase is wrong, the IV or AAD differs, or the ciphertext was modified. Re-enter the exact values used to encrypt. In GCM a failed tag means the data cannot be trusted.
- Bad padding or garbage output (CBC)
CBC has no authentication, so a wrong key often produces padding errors or unreadable bytes. Check the key size, IV, padding mode, and whether the ciphertext is Base64 or Hex.
- Ciphertext starts with U2FsdGVkX1
It was made by CryptoJS or OpenSSL with a salt. Switch the preset to CryptoJS or OpenSSL and enter the original passphrase.
- Passphrase works here but not in another tool
Key derivation differs between tools. Match the PBKDF2 hash, salt, and iteration count — or use a raw hex key so no derivation is involved.
- Invalid Base64 or Hex ciphertext
Paste the complete value without extra spaces or line breaks, and select the same output format used when encrypting.
Frequently Asked Questions
What is AES encryption?
Which AES mode should I use?
What is an IV and why does it matter?
Can I use a regular password as an AES key?
Why does my decryption fail?
Is it safe to encrypt data in my browser?
Is this an online AES tool?
What is the difference between AES-128, AES-192, and AES-256?
What is PBKDF2 and why does this tool use it?
What is AAD (Additional Authenticated Data)?
Can I use this tool to encrypt passwords for storage?
How do I decrypt a CryptoJS string that starts with U2FsdGVkX1?
Can this tool decrypt data from OpenSSL enc?
How large a file can I encrypt?
What is the tm1 bundle format?
How does the tool tell me the key is wrong?
Guide
Related security tools
AES-GCM vs CBC: which mode to use, and the mistakes that still break AES
- Hash Generator
Create SHA-256, SHA-512, and other digests — one-way, unlike AES.
- HMAC Generator
Authenticate AES-CBC or CTR ciphertext with a keyed MAC.
- Password Generator
Generate a strong passphrase to use as your AES secret.
- Base64 Encoder / Decoder
Inspect or convert Base64 ciphertext, IVs, and keys.
- Random String Generator
Generate random strings for salts, IVs, and test keys.
Last updated: