AES Encrypt / Decrypt
AES in your browser with the full option set: CBC / ECB / GCM modes, Pkcs7 / Zero / No padding, 128–256-bit keys, Base64 or Hex output — and a random key generated for you if you leave the box empty.
Privacy: encryption runs entirely in your browser — your key, IV and text are never stored or sent anywhere.
How to use
- Enter the text. Leave the key empty and Encrypt generates a random key (auto-filled, copy it!), or type exactly 16 / 24 / 32 characters for AES-128 / 192 / 256.
- Pick a mode — CBC (default, with an auto-generated IV), ECB (legacy), or GCM (authenticated) — then Encrypt with Base64 or Hex output.
- To decrypt, paste the ciphertext (plus the IV for CBC) with the same key and switch to Decrypt.
Frequently asked questions
Which mode should I choose — CBC, ECB or GCM?
CBC is the classic default used by most online AES tools: it needs a random IV (generated for you) and standard Pkcs7 padding. GCM is the modern choice — it is authenticated, so a wrong key or tampered data fails loudly instead of returning garbage. ECB is offered only for compatibility with old systems: it leaks patterns in your data, so avoid it for anything new.
What happens if I leave the key empty?
When you click Encrypt with an empty key box, the tool generates a random key — sized to the selected key length (32 characters for 256-bit) — and fills the key box so you can see and copy it. Nothing is generated while you are still typing; the key appears only as part of the Encrypt action. Nothing is stored anywhere: copy the key before you leave the page, or the ciphertext becomes undecryptable. This is deliberate: sites that silently fall back to a fixed default for an empty password produce data anyone can decrypt.
Why is my ciphertext different from sojson.com or other online AES tools with the same key, mode and padding?
Three honest differences. First, this tool uses your key as raw bytes (16 / 24 / 32 characters = AES-128 / 192 / 256); tools that treat the key as a passphrase derive the real key through an OpenSSL key-derivation step, so the actual cipher key differs. Second, CBC output depends on the IV — both sides must use the same one. Third, this tool encodes text as UTF-8 only: browsers cannot natively encode GBK, so multi-byte output for Chinese text will differ from GBK-based tools.
What exactly do I paste to decrypt?
For GCM, the whole output — it contains the random IV and the authentication tag alongside the ciphertext, in the Base64 or Hex format you chose. For CBC, the ciphertext plus the same IV (hex) you used to encrypt. For ECB, just the ciphertext. The output format selector applies to encryption; on decryption the input format is detected automatically.
Is my key stored anywhere?
No. The key lives in memory only while this tab is open: nothing is written to localStorage, cookies, or any server. The tool uses the Web Crypto API for GCM, which requires a secure context (HTTPS or localhost) — on an insecure copy of the page you will see a notice instead of a working tool.
Why does GCM refuse my 192-bit key?
That is a browser limitation, not a flaw in the tool: Chromium-based browsers reject 192-bit AES keys in the Web Crypto API (Firefox and Node accept them). If you need AES-192, switch the mode to CBC or ECB, which run on a local library with full key-length support. GCM works with 128-bit and 256-bit keys everywhere.