HomeCrypto ToolsAES Encryption & Decryption

AES Encryption & Decryption

Perform ultra-secure AES encryption and decryption entirely in your browser. Customize key bit depths (128, 192, 256 bits), select custom block cipher chaining modes (CBC, CTR, CFB, OFB, ECB), configure PKCS7 or Zero padding, generate random key material, and visualize data routing via an interactive cryptographic flowchart.

Perform ultra-secure AES encryption and decryption entirely in your browser. Customize key bit depths (128, 192, 256 bits), select custom block cipher chaining modes (CBC, CTR, CFB, OFB, ECB), configure PKCS7 or Zero padding, generate random key material, and visualize data routing via an interactive cryptographic flowchart.

This tool is designed to provide a seamless experience for developers by handling complex operations directly in your browser with maximum speed and security.

100% Private
Instant Results
Customizable
Offline Ready
Dev-Friendly
Easy Export

AES — Advanced Encryption Standard — is a symmetric block cipher that became the global encryption standard in 2001 when NIST selected it to replace the aging DES algorithm. Symmetric means the same key is used for both encryption and decryption — unlike asymmetric encryption (RSA, elliptic curve) where a public key encrypts and a private key decrypts. AES operates on fixed 128-bit blocks of data at a time and supports three key lengths: AES-128 (128-bit key), AES-192 (192-bit key), and AES-256 (256-bit key). More key bits means more possible key combinations and a higher security margin against brute force, though all three are considered secure against any known attack.

AES is a block cipher — it encrypts exactly 128 bits (16 bytes) of data at a time. To encrypt messages longer than 16 bytes, a mode of operation is required to define how the cipher is applied repeatedly across multiple blocks. CBC (Cipher Block Chaining) is the traditional mode — each block of ciphertext is XORed with the previous block before encryption, which means identical plaintext blocks produce different ciphertext blocks and the blocks cannot be reordered or replayed without detection. CBC requires a random initialization vector (IV) to ensure that encrypting the same message twice produces different ciphertext. GCM (Galois/Counter Mode) is the modern recommended mode — it provides both encryption and authenticated integrity verification (authentication tag), meaning tampering with the ciphertext is detectable during decryption. GCM is what TLS 1.3 uses for most HTTPS traffic.

AES has never been broken. The best known attack against AES-128 requires 2^126 operations — computationally infeasible with any technology that exists or is foreseeable. AES-256 is used by the US government for top-secret information and is the algorithm protecting most HTTPS connections, encrypted disk drives, password manager vaults, and end-to-end encrypted messaging apps you use today.

This tool performs AES encryption and decryption on text input directly in your browser. You provide the plaintext (the message you want to encrypt) and a secret passphrase (the encryption key). The tool derives an AES key from your passphrase using a key derivation function, encrypts the plaintext, and outputs the ciphertext as a Base64-encoded string. To decrypt, provide the same passphrase and the ciphertext — the tool reverses the process and recovers the original plaintext. The tool uses the browser's native Web Crypto API for all cryptographic operations — the same implementation used by browsers for HTTPS. The key is derived from your passphrase using PBKDF2 (Password-Based Key Derivation Function 2) with a random salt, which means that even if two people use the same passphrase, the derived AES keys are different. The salt is included in the output so that decryption with the correct passphrase works without needing to store the salt separately. A random initialization vector (IV) is also generated for each encryption operation and included in the output, ensuring that encrypting the same plaintext twice produces different ciphertext even with the same key. All encryption and decryption runs locally. Your plaintext, your passphrase, and the derived cryptographic key material never leave your browser tab. No data is transmitted to any server during this process. This is the critical guarantee that makes this tool appropriate for encrypting genuinely sensitive content — a cloud-based encryption service that processes your plaintext on their server is fundamentally broken as a security tool because the service operator can read your data. Browser-based encryption with the Web Crypto API provides real cryptographic security, not security theater.

1. Enter the text you want to encrypt into the Input Source field — this is your plaintext, the message that will be protected. It can be any text: a password, a secret note, a configuration value, a short message, or any other string. There is no length limit for the input text since AES handles arbitrary-length messages using the mode of operation.

2. Enter your secret passphrase into the Encryption Key (Secret Key) field — this passphrase is used to derive the AES encryption key via PBKDF2. Choose a strong passphrase: at least 12 characters, mixing uppercase, lowercase, digits, and symbols. The same passphrase must be used for decryption — if you lose the passphrase, the encrypted data cannot be recovered. Never use the same passphrase for multiple different sensitive items.

3. Click Encrypt Data — the tool derives an AES key from your passphrase, generates a random initialization vector (IV) and salt, encrypts your plaintext using AES, and outputs the ciphertext as a Base64-encoded string. The output string includes the IV and salt embedded within it so that decryption only requires the ciphertext string and the passphrase — no separate IV or salt needs to be stored or transmitted.

4. Copy the encrypted output and store or transmit it — the Base64 ciphertext string can be safely stored in plain text files, database fields, emails, or any other medium. It is meaningless without the decryption passphrase. Share the ciphertext through one channel and the passphrase through a separate channel (for example, share the ciphertext by email and the passphrase by phone or text message) to reduce the risk of both being intercepted together.

5. To decrypt: paste the Base64 ciphertext into the Input Source field, enter the same passphrase into the Encryption Key field, and click Decrypt Data. The tool extracts the IV and salt from the ciphertext, re-derives the AES key from the passphrase, and decrypts the ciphertext back to the original plaintext. If the passphrase is wrong or the ciphertext has been tampered with, decryption will fail with an error rather than silently producing garbled output.

There are specific situations where you need to encrypt a piece of text and send or store it somewhere that is not itself encrypted — a plain text file, an email, a Slack message, a database field that is not at-rest encrypted, a GitHub repository. In these situations, encrypting the content before it goes to that destination means that even if the destination is compromised, the attacker gets ciphertext that is useless without the decryption key. A shared secret in a configuration file, a personal note with sensitive information, a short message that needs to travel through an unencrypted channel — these are exactly the use cases AES encryption at the tool level addresses. For developers, the most concrete use case is testing and verifying AES implementations. If you are implementing AES encryption in your application — in Node.js with the crypto module, in Python with the cryptography library, in Java with javax.crypto — you need a way to verify that your implementation produces the correct output for a given input and key, and that it can correctly decrypt ciphertext from another system. Encrypting a known plaintext with a known key in this tool and comparing the result with your application's output immediately tells you whether your implementation is correct. The inverse also works: if another system produces encrypted ciphertext, paste it here with the key to verify the plaintext before integrating the decryption into your code. One important scope boundary to state clearly: this tool encrypts text. Encrypting files, encrypting database columns at scale, encrypting communication channels between services — these are handled better by purpose-built tools and libraries (age, GPG, database encryption at rest, TLS). This tool is for the specific case of encrypting a string of text with a shared passphrase for transmission or storage in an otherwise unencrypted location.

Uses the browser's native Web Crypto API — cryptographic operations run using the same implementation browsers use for HTTPS giving you production-grade AES encryption not a JavaScript reimplementation

PBKDF2 key derivation — your passphrase is never used directly as the AES key but is processed through PBKDF2 with a random salt making the derived key resistant to dictionary attacks and rainbow table lookups

Random IV per encryption — a new random initialization vector is generated for every encryption operation so encrypting the same plaintext twice always produces different ciphertext

IV and salt embedded in output — the ciphertext output includes the IV and salt so decryption only requires the ciphertext and passphrase with no separate state to manage or store

100% browser-based — your plaintext passphrase and derived key material never leave your browser tab and are never transmitted to any server

Decryption failure on wrong key — an incorrect passphrase produces a decryption error not garbled plaintext so you know immediately if the wrong key was used rather than silently receiving wrong data

Supports AES-128 AES-192 and AES-256 key lengths and both CBC and GCM modes covering the standard configurations used in production systems

No account or installation required — open the tool enter your text and key and get encrypted output in under a second

Encrypting sensitive configuration values before storing them in plain text files or unencrypted databases

Encrypting a short message or note before sending through an unencrypted channel like standard email

Testing and verifying AES encryption implementations in application code by comparing output with known values

Encrypting API keys or credentials before sharing them with a team member through an insecure medium

Encrypting personal notes or records before storing them in cloud storage that is not end-to-end encrypted

Verifying that a decryption implementation correctly recovers plaintext from a given ciphertext and key

Learning how AES encryption works by seeing the ciphertext output change with different keys and inputs

Encrypting environment variable values before committing placeholder encrypted values to a repository

Example Input

Plaintext: This is a top secret message from Priya.
Key: my-strong-secret-key-2026!

Example Output

Encrypted (AES-256-CBC, Base64):
U2FsdGVkX1+v5S2...8fKmNpQr4xZ1vWs=

Note: The output includes the embedded IV and salt.
Decrypting with the same key recovers the original plaintext exactly.
Decrypting with a different key produces an error — not garbled output.

Invalid Key — Empty or Missing Passphrase: AES encryption requires a non-empty secret key. If the Encryption Key field is empty when you click Encrypt Data or Decrypt Data, the tool will prompt you to enter a passphrase. Choose a strong passphrase of at least 12 characters — short passphrases are vulnerable to brute-force attacks if an attacker obtains the ciphertext.

Decryption Failure — Wrong Key or Corrupted Ciphertext: If you provide the wrong passphrase during decryption, or if the ciphertext string has been modified, truncated, or corrupted in any way, decryption will fail with an error. This is correct and expected behavior — the tool does not silently produce garbled output on a wrong key, it explicitly reports the decryption failure. Verify that you are using the exact same passphrase that was used for encryption and that the entire ciphertext string was copied without modification.

Empty Input: Both the plaintext for encryption and the ciphertext for decryption must be non-empty. If you click Encrypt Data with an empty input field, the tool will prompt you to enter the text you want to encrypt. Paste or type your content into the Input Source field before clicking.

Ciphertext Truncated During Copy: AES ciphertext is output as a Base64-encoded string. If you copy the ciphertext from the output field and the string is truncated — cut off before the final = padding character — decryption will fail because the ciphertext is incomplete. Make sure you copy the entire output string including any trailing = padding characters. The safest approach is to click the Copy button in the output panel rather than manually selecting and copying the text.

Trying to Decrypt Plaintext or Non-AES Content: The Decrypt Data function expects a Base64-encoded AES ciphertext string produced by the Encrypt Data function on this tool or by a compatible AES implementation. Pasting plain text, a hash, a JWT, or any other non-AES-ciphertext content into the input and clicking Decrypt Data will produce a decryption error. The decrypt function cannot detect what the input is — it will attempt decryption and fail when the output does not match the expected structure.

Using AES encryption as a substitute for proper secrets management

Fix: AES encrypting a secret and storing the ciphertext in a repository or config file is only secure if the decryption key is stored and managed securely — and managing that key is exactly the hard part. If the key lives in another config file, another environment variable, or another repository, you have moved the problem rather than solved it. For application secrets in production, use a proper secrets manager: AWS Secrets Manager, HashiCorp Vault, Azure Key Vault, or GCP Secret Manager. These services handle key management, access control, audit logging, and rotation — none of which AES alone provides. Use this tool for personal data encryption and developer testing, not as a substitute for infrastructure secrets management.

Using a weak or predictable passphrase

Fix: The security of AES encryption is only as strong as the secrecy and unpredictability of the key. A passphrase like password, 123456, your-company-name-2026, or the name of the system being protected is vulnerable to dictionary attacks — an attacker who obtains the ciphertext can try common passphrases and variations until they find the right one. Use a randomly generated passphrase of at least 16 characters from a password manager, or generate a random 256-bit key using a cryptographic random number generator and encode it as Base64. The key does not need to be memorable — it needs to be secret and random.

Sharing the ciphertext and the passphrase through the same channel

Fix: If an attacker can intercept your communication channel, sharing both the encrypted message and the decryption key on the same channel gives them everything they need to read the message. The security of encrypted communication depends on the key being delivered through a separate channel from the ciphertext. Share the ciphertext by email — share the passphrase by phone call, SMS, or in person. Share the ciphertext on Slack — share the passphrase by a different method. Even if one channel is compromised, the attacker gets either ciphertext with no key or a key with no ciphertext. Neither is useful alone.

Confusing AES encryption with hashing — expecting to 'decrypt' a hash

Fix: AES encryption is a two-way operation — you can encrypt and decrypt with the correct key. Hashing (MD5, SHA256, bcrypt) is one-way — there is no decryption. If someone gave you an MD5 hash of a password and asked you to decrypt it, that is not possible with any encryption tool. Hashing is not encryption. If you need to verify a password, hash the input and compare hashes — do not try to decrypt the stored hash. If you need to store a value that you can recover later, encrypt it with AES and store the ciphertext. These are different tools for different purposes.

Using the same passphrase for multiple different sensitive items

Fix: If you encrypt multiple different secrets with the same passphrase and an attacker compromises one of them — by obtaining both the ciphertext and the key through different means — they have the key to decrypt all the others. Use a unique passphrase for each distinct secret. A password manager makes this practical: store a separate randomly generated passphrase for each encrypted item alongside the ciphertext, protected by the password manager's master password. This way, compromising one encrypted item does not cascade to all others.

Is AES encryption breakable?

AES has never been broken by any known attack. The best theoretical attack against AES-128 requires approximately 2^126 operations — a number so large it exceeds the computational capacity of any technology that exists or could plausibly be built. AES-256 provides an even larger margin. AES is used by the US National Security Agency for top-secret information, by every TLS implementation for HTTPS traffic, by encrypted disk drives (FileVault, BitLocker), by end-to-end encrypted messaging apps, and by password managers. The algorithm itself is not the weak point. The weak points in AES-based systems are always the key management: weak passphrases, keys stored insecurely alongside the ciphertext, or keys transmitted through the same channel as the ciphertext.

What key length should I use?

AES-256 for anything new. All three key lengths (AES-128, AES-192, AES-256) are secure against any known attack, but AES-256 provides the largest security margin against future advances in cryptanalysis and is what most modern security standards and compliance frameworks (FIPS 140-3, NIST SP 800-131A) require or recommend. The performance difference between AES-128 and AES-256 is negligible on modern hardware — modern CPUs have AES-NI hardware acceleration that makes AES extremely fast at all key lengths. There is no good reason to use AES-128 for new implementations when AES-256 is available.

Is it safe to use this tool for passwords?

AES encryption is not the right tool for storing passwords. For storing passwords, use a purpose-built password hashing function: bcrypt, Argon2id, or PBKDF2 with a high iteration count. These are designed to be computationally expensive so that brute-forcing a stolen password hash takes an impractically long time. AES encryption is reversible with the correct key, which means a stolen AES-encrypted password database is only as secure as the key — if the key is compromised, all passwords are immediately recoverable. Use bcrypt for passwords. Use AES for data you need to recover — like a configuration value or a message — not for one-way verification like authentication.

What is the difference between AES-CBC and AES-GCM?

AES-CBC (Cipher Block Chaining) provides confidentiality — it encrypts the data so an attacker cannot read it. It does not provide authentication — an attacker can modify the ciphertext and the decryption might succeed but produce different plaintext without you knowing the data was tampered with. AES-GCM (Galois/Counter Mode) provides both confidentiality and authenticated integrity. GCM generates an authentication tag during encryption. During decryption, GCM verifies the tag before returning plaintext — if the ciphertext was tampered with, GCM decryption fails with an authentication error. For new implementations, prefer GCM. CBC is still widely used but requires additional integrity mechanisms (HMAC) to be secure against chosen-ciphertext attacks.

Can I decrypt AES ciphertext from this tool in my application code?

Yes, if your application code uses compatible AES parameters. The tool uses AES with PBKDF2 key derivation, a random salt, and a random IV — all embedded in the Base64 output. To decrypt in code, you need to parse the output format to extract the salt and IV, re-derive the key from the passphrase using PBKDF2 with the same parameters (hash algorithm, iteration count, key length), then decrypt using AES with the extracted IV. In Node.js use the crypto module, in Python use the cryptography library, in Java use javax.crypto. The exact PBKDF2 parameters and output format depend on the tool's implementation — check the tool's source code or documentation for the specific parameters to reproduce in your application.

Does this tool store my encrypted data or passphrase anywhere?

No. All encryption and decryption runs in your browser using the Web Crypto API. Your plaintext, your passphrase, and the derived AES key exist only in memory during the encryption operation and are never transmitted to any server, never written to disk, and never logged. When you close the browser tab, all of that data is gone. This is the fundamental security property that makes browser-based encryption meaningful — a server-side encryption service is inherently untrustworthy because the server operator has access to your plaintext and key during processing.

How do I implement AES encryption in my application?

In JavaScript (Node.js): use the built-in crypto module with crypto.createCipheriv('aes-256-cbc', key, iv) or the Web Crypto API with subtle.encrypt({name: 'AES-GCM', iv}, key, data). In Python: use the cryptography library with Fernet for a high-level API or Cipher from cryptography.hazmat.primitives.ciphers for AES directly. In Java: use javax.crypto.Cipher.getInstance('AES/GCM/NoPadding'). For key derivation from a passphrase, use PBKDF2 in all languages rather than using the passphrase directly as the key. Never implement AES from scratch — always use the platform's cryptographic library which is tested, audited, and hardware-accelerated.

What happens if I lose the encryption key?

The data is permanently unrecoverable. AES encryption is designed so that the ciphertext reveals nothing about the plaintext without the correct key — that is the entire point. There is no master key, no recovery mechanism, and no way to brute-force the decryption within any human timeframe if a strong passphrase was used. This is not a limitation of this tool — it is the security property that makes AES encryption worth using. Store your encryption passphrases in a password manager. If you are encrypting data for an application, treat the encryption key as a critical piece of infrastructure and back it up using the same care you would apply to database credentials or TLS private keys.