AES Encryption
AES-GCM encryption with PBKDF2 — your text and passphrase never leave your browser
Plaintext
Text to encrypt
Examples
Inspect the bundled payload layout
plaintext: hello world
passphrase: my-passAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAtNX3zp3Yxthw8/Lc//+gbMO+krelesUhcJafw==Layout is salt (16 bytes) + IV (12 bytes) + ciphertext + 16-byte GCM tag, all Base64-encoded. The leading salt and IV bytes are 0x01×16 and 0x02×12 here only because they were fixed to make this example reproducible — the real tool uses fresh random bytes each run, so the output changes every time even for identical input.
Round-trip the same passphrase
plaintext: hello world
passphrase: my-pass
[run Decrypt on the payload above]hello worldDecrypting the payload above with passphrase 'my-pass' reproduces the original plaintext, confirming the format is reversible when the passphrase matches.
Wrong passphrase fails closed
payload: AQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAtNX3zp3Yxthw8/Lc//+gbMO+krelesUhcJafw==
passphrase: wrongDecryption failed — wrong passphrase or corrupted ciphertext.AES-GCM's authentication tag forces the decryption to throw when the key is wrong, instead of silently returning garbage — the tool surfaces that as a red error message.
About this tool
The AES Encryption tool encrypts and decrypts short text entirely in your browser using AES-GCM, the modern authenticated-encryption mode of the Advanced Encryption Standard. There is no configuration to learn: type the text, choose a passphrase, and click Encrypt to get a single Base64 payload that contains everything needed to decrypt it later.
Under the hood the tool runs the Web Crypto API. Your passphrase is first run through PBKDF2 with 100,000 iterations of SHA-256 and a freshly generated 16-byte salt, producing a 256-bit AES key. The text is then encrypted with AES-GCM using a fresh 12-byte IV, and the resulting ciphertext is appended with a 128-bit authentication tag — AES-GCM detects tampering by failing to decrypt when even a single byte has been altered.
The output Base64 string bundles the salt, IV, ciphertext and authentication tag in that order. Decryption splits the same Base64 back into its parts, re-derives the key from the passphrase and the stored salt, and verifies the authentication tag before returning the plaintext. Because the passphrase is never sent anywhere and the salt and IV are regenerated on every encryption, the same text with the same passphrase produces a different ciphertext every time.
How to use
Pick a passphrase
Use a long, high-entropy passphrase — the strength of the encryption depends entirely on its quality, not on the algorithm.
Encrypt or decrypt
Stay on Encrypt to turn plaintext into a Base64 payload, or switch to Decrypt to paste a previously generated payload and the same passphrase.
Copy or paste the Base64 result
Copy the Base64 output for safe storage or transit, or paste a Base64 payload into Decrypt with its passphrase to recover the original text.
Read the error when something fails
If decryption returns an error, the passphrase is wrong or the ciphertext has been altered — AES-GCM intentionally refuses to return anything rather than producing corrupted plaintext.
Use cases
Encrypting an API key or token before pasting it into a public file
Wrap secrets in an AES-GCM payload and commit the result with the passphrase kept elsewhere.
Exchanging short sensitive messages with a known recipient
Share the Base64 ciphertext over any channel — only the holder of the passphrase can read it.
Encrypting notes for personal storage
Keep a ciphertext in a notes file and recall it later by running the same passphrase through the Decrypt tab.
Demonstrating authenticated encryption
Show how GCM differs from older modes by altering one byte of a payload and watching decryption fail instead of returning corrupted text.
Common mistakes
Mistake:Treating the Base64 payload as encrypted with the passphrase alone.
Fix:The salt and IV are stored inside the payload and re-used on decryption, but the passphrase is never stored — losing it means the ciphertext is unrecoverable.
Mistake:Using a short, low-entropy passphrase.
Fix:PBKDF2 with 100k iterations slows brute force, but a guessable passphrase can still be cracked offline. Use a long passphrase or a random one stored in a password manager.
Mistake:Assuming two encryptions of the same text with the same passphrase will match.
Fix:Each call generates a fresh random 16-byte salt and 12-byte IV, so the output bytes are different every run — that is intentional and is what makes the encrypted text non-deterministic.
Mistake:Reusing this output as a password hash.
Fix:AES-GCM is a reversible cipher, not a one-way password hash. Use bcrypt or Argon2 for password storage; use this tool when you need to be able to decrypt the value later.
Frequently asked questions
Related guides
Encryption Tools Explained: AES vs BCrypt vs HMAC
Three cryptographic primitives developers constantly confuse — reversible encryption (AES), password hashing (BCrypt), and message signing (HMAC). What each one is for, and how to pick correctly.
Generating Secure API Tokens and Secrets in the Browser
How to create cryptographically strong tokens, sign payloads with HMAC, and encrypt data with AES — all client-side, with nothing sent to a server.
References & standards
Related tools
Basic Auth Generator
Generate an HTTP Basic Authentication header from a username and password. Produces the Authorization header and ready-to-use curl and fetch snippets. Runs fully client-side.
Bcrypt Generator & Verifier
Hash passwords with bcrypt and verify hashes — choose your cost factor (rounds 4–15), get a secure hash instantly, and check whether a password matches a hash. Runs entirely in your browser.
BIP39 Mnemonic Generator
Generate and validate BIP39 seed phrases locally for testing
Checksum Calculator
Compute file checksums (SHA-1, SHA-256, SHA-384, SHA-512) in your browser with the Web Crypto API
CORS Header Validator
Validate Cross-Origin Resource Sharing headers for security compliance
CORS Policy Builder
Build CORS response headers, Nginx directives, and JavaScript fetch examples for safe cross-origin requests and preflight handling