AES-256 Encrypt / Decrypt Online - Free, In-Browser
Encrypt and decrypt text with AES-128, AES-192, or AES-256 in GCM, CBC, or CTR mode. PBKDF2 key derivation, entirely in your browser.
Reviewed by Aygul Dovletova · Last reviewed
Encrypts with AES-128, AES-192, or AES-256 in GCM, CBC, or CTR mode, using PBKDF2-SHA-256 key derivation (600,000 iterations, matching the OWASP 2024 recommendation). Everything runs in your browser - your data never leaves your device. Decrypt auto-detects the mode and key size from the ciphertext, so you do not need to remember them.
How to Use the AES Encrypt / Decrypt Tool
- Pick Encrypt or Decrypt. Encrypt turns text into a Base64 ciphertext string; Decrypt reverses it.
- Paste your input. Plaintext for Encrypt, the Base64 blob for Decrypt.
- Enter a strong password. A four-word passphrase or a 16+ character password-manager string is a reasonable minimum.
- Optionally open Advanced options on Encrypt to pick a cipher mode (AES-GCM, AES-CBC, AES-CTR) and key size (AES-128, AES-192, AES-256). Defaults are AES-256-GCM.
- Press Encrypt or Decrypt. The tool derives a key with PBKDF2-HMAC-SHA-256 and runs AES inside your browser. Copy the output with the inline Copy button.
- Share ciphertext and password through different channels. Both together equals no security.
What the Tool Does, Under the Hood
AES (Advanced Encryption Standard) is the symmetric cipher standardised by NIST in 2001, implemented in hardware on every modern CPU via AES-NI, and the same algorithm your browser uses for TLS.
This tool calls the browser's native crypto.subtle Web Crypto API directly. On Encrypt, it generates a fresh 16-byte salt, derives a key with PBKDF2-HMAC-SHA-256 at 100,000 iterations, generates a fresh IV (12 bytes for GCM, 16 for CBC/CTR), runs AES, and Base64-encodes the blob version | mode | keyBits | salt | iv | ciphertext. On Decrypt, the tool reads the first byte to recover mode and key size, so you never need to remember which options you picked. Legacy ciphertexts from before the mode selector still decrypt through an AES-256-GCM fallback path.
When and Why to Use It
- Sending a sensitive note through a channel you do not fully trust (email, tickets, shared docs).
- Storing API keys or recovery phrases as ciphertext inside notes apps that sync across devices.
- Creating a tamper-evident archive: with GCM, any ciphertext modification causes decrypt to fail loudly.
- Quickly protecting a snippet before pasting into a bug tracker, screenshot, or public paste.
- Teaching authenticated encryption in a workshop, or sanity-checking another AES implementation.
Cipher Mode Comparison: GCM vs CBC vs CTR
AES-GCM is the default and right for almost everyone. It combines counter-mode encryption with a 128-bit authentication tag in one pass, so tampering is detected on decrypt. TLS 1.3 made AEAD modes like GCM mandatory.
AES-CBC only provides confidentiality. An attacker who modifies the ciphertext can silently flip plaintext bytes, and CBC is notorious for padding-oracle vulnerabilities. Pick CBC only to interoperate with a system that does not speak GCM.
AES-CTR turns AES into a stream cipher - as fast as GCM but without the authentication tag. Reusing a counter with the same key is catastrophic. The tool always generates a fresh random counter, so single-message use is safe.
Key Size: AES-128, AES-192, and AES-256
All three are considered secure against every known classical attack. AES-128 uses 10 rounds, AES-192 uses 12, AES-256 uses 14, so AES-128 is about 40 percent faster per byte than AES-256. On modern AES-NI hardware the difference is negligible. AES-256 is the conservative recommendation because it carries the largest safety margin, including roughly 128 bits of post-quantum security after Grover\'s algorithm. Pick AES-128 only for 128-bit-only systems; AES-192 only when a compliance profile mandates it.
Common Pitfalls
- Weak passwords. PBKDF2 at 100,000 iterations slows brute force, but a six-character password still falls on a GPU rig in minutes. Use a passphrase or password manager.
- Sending ciphertext and password together. Any adversary who sees both has full access. Use two channels.
- Losing the password. There is no recovery path; lost password equals lost contents.
- Using CBC or CTR without external integrity. If tampering matters, stay on GCM, or add a separate HMAC when you must use CBC.
- Assuming Base64 alone is encryption. It is not. Always run AES first, then Base64-encode for transport, which is what this tool does.
Ciphertext Format
The Base64 output is a binary blob version(1) | mode(1) | keyBits(1) | salt(16) | iv(12 or 16) | ciphertext(+16-byte GCM tag). Version byte is 0x01; mode codes are GCM=0x00, CBC=0x01, CTR=0x02; key-size codes are 128=0x00, 192=0x01, 256=0x02. Decrypt auto-detects everything. The legacy layout (no header, AES-256-GCM, 28-byte prefix) falls back transparently.
Frequently Asked Questions
What is AES-256 and why 256 bits?
AES-256 is the Advanced Encryption Standard with a 256-bit key, the largest of three standard AES key sizes. It is approved by NIST and NSA Suite B for protecting classified information up to TOP SECRET. A 256-bit key means a brute-force search covers 2^256 possibilities, astronomically beyond any current or foreseeable computing effort. The practical reason to pick 256 over 128 is a larger safety margin against future cryptanalysis and against Grover's algorithm, which leaves roughly 128 bits of effective post-quantum security.
Is it safe to encrypt online with a browser-based tool?
Yes, provided the tool runs entirely in your browser and never sends your plaintext to a server. This page uses the browser's native Web Crypto API (the same implementation used for TLS) and performs salt generation, PBKDF2 key derivation, AES encryption, and Base64 encoding locally. Nothing is uploaded, logged, or written to persistent storage. You can confirm this in DevTools Network and even disconnect from the internet after the page loads. The remaining risk is your own device - malware can read plaintext before encryption no matter what tool you use.
What is the difference between AES-128, AES-192, and AES-256?
They differ in key length, round count, and safety margin. AES-128 uses a 128-bit key and 10 rounds; AES-192 uses 192 bits and 12 rounds; AES-256 uses 256 bits and 14 rounds. All three are secure against every known classical attack. AES-128 is about 40 percent faster per byte than AES-256 on hardware without AES-NI, but the gap is negligible on modern CPUs. Pick AES-256 for long-term archives, AES-128 when constrained by an older system, AES-192 only when a compliance profile mandates it.
Which cipher mode should I use - GCM, CBC, or CTR?
Use GCM unless you have a specific reason to pick something else. AES-GCM is authenticated encryption: it provides both confidentiality and integrity in a single pass, so a tampered ciphertext is detected on decrypt instead of silently returning garbage. AES-CBC and AES-CTR only provide confidentiality, so an attacker who modifies the ciphertext can corrupt plaintext without being caught, and CBC historically suffers from padding-oracle attacks. Pick CBC or CTR only to interoperate with a system that mandates them, and combine with a separate HMAC when integrity matters.
Is my plaintext or password sent to a server?
No. Everything runs inside your browser through the Web Crypto API. Plaintext, password, salt, IV, and ciphertext are created and consumed locally, never serialised over the network or written to persistent storage. You can disconnect from the internet right after the page loads and the tool keeps functioning. The only bytes that travel over the network are the static page assets themselves, cached by Cloudflare.
Why does each encryption of the same text produce a different output?
Every Encrypt click generates a fresh 16-byte random salt and a fresh IV (12 bytes for GCM, 16 for CBC and CTR). Both are stored inside the Base64 output so decrypt can recover them. Randomising salt and IV means identical plaintexts never produce identical ciphertexts, so an attacker learns nothing by comparing outputs. Reusing an IV with the same key is catastrophic in every AES mode, which is why the tool regenerates it on every call.
What happens if I lose the password?
The ciphertext is mathematically unrecoverable without the correct password. AES combined with PBKDF2 at 100,000 iterations has no backdoor, no master key, no password-reset. Brute forcing a strong password (a long random passphrase or a 16-character password-manager output) is infeasible within any realistic timescale. Store the password in a password manager or write it down somewhere physically secure. Lose it and the encrypted data is permanently inaccessible - that is the point.
Can I decrypt this ciphertext in another AES tool?
Only if the other tool implements the same format. This page prepends a three-byte header (<code>version | mode | keyBits</code>) before the <code>salt | iv | ciphertext</code> layout and uses PBKDF2-HMAC-SHA-256 at 100,000 iterations with a 16-byte salt. If integrating with custom code, replicate the header parsing, use <code>crypto.subtle.importKey</code> + <code>deriveKey</code> with matching parameters, and run the corresponding AES mode. Cross-tool compatibility is easiest with the legacy layout (AES-256-GCM, no header) older versions of this tool emitted.
Does this work with Unicode, emoji, and non-Latin scripts?
Yes. The tool encodes text as UTF-8 with <code>TextEncoder</code> before encryption and decodes the same way after decryption, so Chinese, Arabic, Cyrillic, and emoji all survive a full round trip. Raw binary data (images, PDFs) is not supported through this text-only interface; for that, Base64-encode the binary first with the <a href="/tools/base64-encode-decode/">Base64 tool</a> and encrypt the resulting text. Decrypt, then Base64-decode to recover the original bytes.
What size of input can I encrypt in the browser?
There is no protocol cap below 2^39 bytes per AES-GCM key, but browser memory is the practical limit. Inputs up to roughly a megabyte encrypt in well under a second. Tens of megabytes briefly freeze the tab during PBKDF2, and anything near a gigabyte risks crashing the page. For large files, prefer a streaming desktop tool such as <code>openssl enc</code>, <code>age</code>, or <code>gpg --symmetric</code>.
More Security & Privacy
Basic Auth Header Generator
Create HTTP Basic Authentication headers from a username and password or API token.
Open toolCSP Header Generator
Build Content-Security-Policy headers with a visual form, presets and per-directive configuration.
Open toolPassword Entropy Calculator
Estimate password entropy, character pool size and crack-time ranges for online and offline attacks.
Open toolPassword Generator
Generate cryptographically secure random passwords with configurable length, character types and entropy display.
Open toolPassword Strength Checker
Check password strength with entropy calculation, pattern detection and common password matching.
Open toolPBKDF2 Hash Generator
Derive cryptographic keys from passwords using PBKDF2 with configurable iterations, salt and hash function.
Open tool