AES Encrypt/Decrypt
Free online AES encrypt/decrypt tool. Encrypt text with AES-128, AES-192 or AES-256 in GCM or CBC mode. PBKDF2 key derivation with a random per-message salt. All processing is local and private.
Enter text and a key, then click Encrypt or Decrypt.
Advanced: legacy v1 format (fixed salt)
How to Use AES Encrypt/Decrypt
Enter Text & Key
Type or paste the text into the left panel and enter a secret passphrase. Use at least 16 characters — the strength meter shows how much entropy your key provides. Keep the key safe: without it, decryption is impossible.
Pick Algorithm Options
Choose the key size (AES-128, AES-192 or AES-256), the block mode (GCM recommended, CBC for compatibility with other tools) and the output encoding (Base64 or Hex). PBKDF2 iterations control how expensive a brute-force attack is.
Encrypt or Decrypt
Click "Encrypt" to turn your text into ciphertext, or paste ciphertext and click "Decrypt". The output format stores the salt, IV and algorithm settings, so decryption only needs the correct passphrase.
Copy the Result
Click "Copy" to copy the ciphertext. Use "Swap" to move the output back into the input for round-trip testing. Everything runs locally in your browser — nothing is uploaded.
Examples
Before (Plain Text)
The quick brown fox jumps over the lazy dog. 🦊 After (AES-256-GCM, Base64)
AgIA7QFVkF3mQp2sVb8xLrT4nHcE... (Base64 of salt + IV + ciphertext) Ciphertext changes on every run because the salt and IV are random.
Frequently Asked Questions
What is AES encryption?
AES (Advanced Encryption Standard) is the most widely used symmetric encryption algorithm. It was established by NIST in 2001 and is used worldwide to protect classified information, secure web traffic (TLS), encrypt files and protect databases. AES uses the same key for encryption and decryption — symmetric encryption. This tool derives a 128, 192 or 256-bit key from your passphrase using PBKDF2-SHA256 with a random per-message salt.
What is the difference between AES-128, AES-192 and AES-256?
The number refers to the key length in bits. AES-256 uses a 256-bit key (32 bytes) and provides the largest security margin; AES-192 uses 24 bytes and AES-128 uses 16 bytes. All three are considered secure against classical attacks today. AES-256 is the most conservative choice against future quantum attacks (Grover's algorithm halves the effective key length, leaving AES-256 with a 128-bit margin). AES-128 is slightly faster and is sufficient for most applications.
Should I use GCM or CBC mode?
Use AES-GCM whenever you can. GCM is an authenticated (AEAD) mode: it produces an authentication tag alongside the ciphertext, so tampering or a wrong key is detected reliably and decryption fails loudly. AES-CBC only provides confidentiality — it detects neither tampering nor a wrong key, so a wrong passphrase usually yields garbage output instead of an error. CBC is offered only for compatibility with older systems and libraries (for example CryptoJS defaults). If you must use CBC, authenticate the ciphertext separately with an HMAC.
How is my passphrase turned into a key?
Your passphrase is stretched with PBKDF2-HMAC-SHA256 using a fresh 16-byte random salt generated for every encryption, and 250,000 iterations by default (you can raise this to 600,000 or 1,000,000). Because the salt is random per message, the same passphrase produces a different key every time, which defeats precomputed rainbow tables. The salt is stored in the output so decryption can reproduce the key. Note that PBKDF2 protects against brute-force, but a weak passphrase is still weak — use a long random key, or generate one with the "Generate" button.
Is browser-based encryption secure?
This tool uses the Web Crypto API (crypto.subtle), which provides native, hardware-accelerated AES in the browser, and the cryptography itself is sound. All processing happens locally — nothing is sent to a server. However, browser-based encryption has inherent risks: your key sits in memory, the page could be compromised by XSS, and malicious browser extensions could intercept data. For truly sensitive data, use a dedicated encryption application rather than a web tool.
Can I decrypt text that was encrypted by another tool?
Only if the other tool uses the exact same construction. This tool packs salt, IV, algorithm parameters and ciphertext into one binary blob and Base64/Hex encodes it — that layout is specific to this page. Standard OpenSSL "enc" output starts with the bytes "Salted__" and uses a different KDF (or MD5 in legacy mode), so it will not decrypt here. If you need cross-tool compatibility, use a command-line tool such as OpenSSL where you control every parameter explicitly.
Understanding AES Encryption
AES is a block cipher: it encrypts data in fixed 16-byte blocks using a secret key. A mode of operation describes how to chain those blocks together to encrypt a message of any length, and an initialization vector (IV) makes sure the same plaintext never produces the same ciphertext twice. The IV is not secret — it is stored alongside the ciphertext — but it must never be reused with the same key.
GCM vs CBC
AES-GCM is an AEAD mode. Besides encrypting, it computes a 128-bit authentication tag over the ciphertext, so any modification — or a wrong key — causes decryption to fail with an error. AES-CBC only hides the content. It cannot tell you whether the ciphertext was altered or whether you typed the right passphrase, which is why a wrong CBC passphrase often produces mojibake instead of an error. Prefer GCM unless you need to interoperate with a system that only speaks CBC.
From Passphrase to Key: PBKDF2
People remember passphrases, but AES needs a fixed-length key of exactly 16, 24 or 32 bytes. PBKDF2-HMAC-SHA256 bridges that gap: it hashes the passphrase together with a random 16-byte salt, repeatedly, for a configurable number of iterations. The salt ensures two encryptions of the same message under the same passphrase are unrelated, which is what makes precomputed rainbow tables useless. The iteration count deliberately slows down each guess — 250,000 iterations is the default here, and you can raise it to 1,000,000 if you can tolerate the delay.
Output Format
The result of an encryption is a single binary blob that is then Base64 or Hex encoded:
[version 0x02][key size][iterations][mode][salt 16B][IV 12B or 16B][ciphertext] Because the algorithm parameters travel with the data, decryption only needs the passphrase — you do not have to remember which key size or mode you picked. This layout is specific to this tool, so it is not interchangeable with OpenSSL or CryptoJS output.
Security Notes
- Encryption runs entirely in your browser via the Web Crypto API — no key, plaintext or ciphertext leaves your device.
- A strong passphrase matters more than the key size. Use the "Generate" button to create a random 24-character key and store it in a password manager.
- If you lose the key, the data is unrecoverable. There is no reset or backdoor.
- Never reuse the same key and IV pair. This tool generates a fresh random IV for every encryption.
- AES protects data at rest or in transit; it does not protect you if the machine doing the encryption is already compromised.
Related Articles
AES Encryption Explained
How Rijndael works, block cipher modes, IV reuse, padding oracles, PBKDF2.
Crypto Tools Guide
Hashing, HMAC, encryption and password security.
Password Generator
Create strong random keys for AES encryption.
Hash Generator
MD5, SHA-1, SHA-256, SHA-512.
HMAC Generator
Generate HMAC with SHA-256 and SHA-512.
RSA Key Generator
Generate RSA public/private key pairs.