AES Encrypt / Decrypt
Please read before use
• This tool runs entirely in your browser. No plaintext, ciphertext, or key is sent to a server.
• It is intended for development, debugging, learning and self-managed scenarios. Do not use this page as the only protection for production secrets, customer data, or anything that requires auditing.
• For real applications: use audited libraries (libsodium, OpenSSL, AWS Encryption SDK), a real KDF (Argon2id ≥ 1 iteration / 64 MiB), AEAD modes only, and manage keys on the server with proper access control.
UTF-8 text
Mode comparison — GCM vs CBC vs CTR▼
| Mode | Authentication | IV requirement | Performance | Recommended use |
|---|---|---|---|---|
| AES-GCM | Yes (AEAD, 128-bit tag) | 12 bytes (recommended); never reuse with same key | Fast, hardware-accelerated | Default — modern API, file encryption, anything authenticated |
| AES-CBC | No — must add HMAC/MAC | 16 bytes; unpredictable (CSPRNG) and never reuse | Fast, hardware-accelerated | Legacy TLS, disk encryption (XTS-AES), never use raw for new designs |
| AES-CTR | No — must add HMAC/MAC | 16 bytes; never reuse with same key (catastrophic if reused) | Fastest, parallelizable | Random-access streams, disk encryption, but combine with MAC |
Reading the table
- • AES-GCM is the only AEAD among the three — it both encrypts and authenticates in one step. If you don't know which to choose, choose GCM.
- • CBC and CTR only provide confidentiality. They need a separate MAC (HMAC-SHA256, compute-then-MAC) or they are vulnerable to chosen-ciphertext and bit-flipping attacks.
- • Both IV and nonce must be unique per (key, message). GCM with a reused IV leaks the authentication key — treat as catastrophic.
Mode and format notes
- • Browser SubtleCrypto only provides GCM, CBC, and CTR for AES—not ECB, CFB, or OFB (to prevent weak usage). For other modes, use OpenSSL or a server-side library.
- • Ciphertext format options: Hex / Base64 / Base64URL, aligned with CyberChef, APIs, JWT, etc. Both encrypt and decrypt sides must use the same format.
- • Under AES-GCM, output is a continuous byte stream of "ciphertext + authentication tag"; this tool encodes the entire block into the selected format—paste the whole block when decrypting.
Notes
- • Web Crypto runs entirely in the browser; GCM is authenticated encryption, suitable for default scenarios.
- • On encrypt, leave IV empty and the tool will generate a random IV and fill it above for reuse during decryption.
- • On decrypt, leave IV empty to try an all-zero vector (only valid when the other party uses the same convention).
Free online AES encrypt/decrypt tool for AES-CBC, AES-GCM, and AES-CTR. Supports AES-128/192/256 keys, Hex/Base64/Base64URL ciphertext formats, PBKDF2-SHA256 password-based key derivation, random IV/salt generation, and browser-only Web Crypto processing.