AES-256 Encrypt & Decrypt
Encrypt and decrypt text with AES-256 in GCM or CBC mode using a passphrase. Runs entirely in your browser, so your text and key never leave your device.
Decryption only works on ciphertext produced by this tool (or anything using the same salt+IV+mode-prefixed layout) with a matching passphrase and output format.
Plain text
Stays in your browserCiphertext
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Free Online AES-256 Encrypt & Decrypt Tool
Encrypt text with a passphrase using AES-256, or decrypt ciphertext produced by this tool — key derivation (PBKDF2) and encryption both run locally via your browser's native Web Crypto API, never a server. Use it to encrypt and decrypt text with AES in your browser, with a password or a key. It helps developers protect a local note or test payload with a passphrase when they need encryption rather than reversible encoding.
How AES-256 encryption works here
AES (Advanced Encryption Standard) is a symmetric cipher — the same passphrase is used to both encrypt and decrypt, unlike RSA's public/private key pair. Since a raw passphrase isn't itself a valid 256-bit AES key, this tool first runs it through PBKDF2 (Password-Based Key Derivation Function 2) with a random salt and 250,000 iterations of SHA-256, which turns a human-memorable passphrase into a proper cryptographic key while making brute-force guessing meaningfully slower for an attacker. The derived key is then used with AES in either GCM or CBC mode to actually encrypt your text.
GCM vs. CBC — which mode to pick
AES-GCM is an authenticated encryption mode: it produces a built-in authentication tag, so tampering or corruption of the ciphertext is detected and decryption fails outright rather than returning silently-wrong plaintext. It's the recommended default and what most modern systems (TLS 1.3 included) use. AES-CBC encrypts but doesn't authenticate on its own — it's included for compatibility with systems that specifically expect CBC, not because it's a safer choice.
Why Base64 encoding is not encryption
It's worth being explicit about this since the two are easy to conflate: Base64 (see the Encode / Decode tool) is a reversible text encoding with no key or secret involved — anyone can decode it instantly, and it provides precisely zero confidentiality. AES encryption, in contrast, transforms data using a secret key such that recovering the original text without that key is computationally infeasible. This tool's ciphertext output happens to be displayed as Base64 or Hex text purely so it's easy to copy and paste — the actual security comes entirely from the AES encryption performed before that encoding, not from the encoding itself.
How to use this tool
Choose Encrypt or Decrypt, pick an AES mode (for encrypting) and an output format, enter your text and passphrase, then run it. Save or share the resulting ciphertext along with the passphrase (through a separate, secure channel) — decryption needs both the exact passphrase and the unmodified ciphertext to succeed.
Worked example
Encrypting Hello, World! (13 characters) with AES-GCM produces a 58-byte combined output (1 mode byte + 16-byte salt + 12-byte IV + 13 bytes of ciphertext + a 16-byte GCM authentication tag), which Base64-encodes to exactly 80 characters — checked in testing. Encrypting the exact same text and passphrase again produces a completely different ciphertext each time, since a fresh random salt and IV are generated per encryption — that's expected, not a bug, and both outputs decrypt back to the same plaintext with the right passphrase.
Common mistakes and edge cases
- Don't expect the same ciphertext twice — encrypting identical text and passphrase produces a different result every time by design, since the salt and IV are freshly randomized per run. Compare decrypted plaintext, not raw ciphertext, when checking two encryptions match.
- AES-CBC has no authentication tag in any implementation, which means an error on decryption isn't a fully reliable "wrong passphrase" signal, and success isn't fully reliable proof either — in testing, about 1 in 256 wrong-passphrase attempts happens by chance to pass CBC's padding check and returns garbage text instead of failing. This is inherent to how CBC works, not a gap in this tool specifically; AES-GCM's authentication tag closes it entirely, which is why GCM is the default here.
- Losing even one character of the ciphertext, or mixing up Base64/Hex between encrypt and decrypt, fails the same way a wrong passphrase does — there's no separate error message distinguishing "wrong passphrase" from "corrupted ciphertext."