Decrypt XOR ciphertext without the key: brute-force single-byte keys, break repeating-key XOR, crib-drag known plaintext. Text, hex or Base64, in-browser.
By Inventive HQ
This free online XOR decoder does three jobs: it encrypts and decrypts data with a key you supply, it brute-forces short keys when you have none, and it breaks repeating-key XOR outright by recovering the key from the ciphertext alone. Input and output can each be plain text, hexadecimal, or Base64, and the key can be given as text, as hex bytes, or as a single byte. Everything runs in your browser — the brute-force search runs in a Web Worker so the interface stays responsive while it grinds — and no ciphertext is ever uploaded.
XOR is the exclusive-or operation applied byte by byte between plaintext and key. It is the simplest useful cipher and the one you meet constantly in CTF challenges, malware analysis, firmware inspection, and obfuscated JavaScript, because it is trivially implementable in a few instructions and leaves the data the same length. Its defining property is symmetry: plaintext XOR key = ciphertext and ciphertext XOR key = plaintext. There is no separate decryption routine — encoding and decoding are the same operation, which is why this tool has one Encrypt/Decrypt tab rather than two.
XOR compares two bits and returns 1 only when they differ:
| A | B | A XOR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Applied to bytes, encrypting the character H (ASCII 0x48, binary 01001000) with the key byte 0x2A (00101010) gives 01100010 = 0x62. XOR the result with 0x2A again and you are back to 0x48. The two identities that make the whole tool possible are x XOR x = 0 and x XOR 0 = x.
Encrypting the string HELLO with the single-byte key 0x2A produces the hex 62 6f 66 66 65. With a multi-byte key such as KEY, the key repeats cyclically across the plaintext: byte 0 uses K, byte 1 uses E, byte 2 uses Y, byte 3 uses K again, and so on. That repetition is precisely the weakness the cryptanalysis tab exploits.
de ad be ef, or single-byte when the key is one value.Because XOR is its own inverse, the same operation covers both directions. If your output looks like noise, either the key is wrong or your input format is misidentified — a Base64 string parsed as text is a very common cause of “the decoder is broken”.
Single-byte XOR has only 256 possible keys, so exhaustive search is instant. Set Max Key Length to 1 byte and the tool tries every value from 0x00 to 0xFF, scores each candidate plaintext against English letter frequencies, and ranks the results. In practice the correct key is almost always the top hit for anything longer than a few dozen bytes of English text.
You can extend the search to 2, 3, or 4 bytes, and the tool shows the keyspace up front so you know what you are asking for:
| Max key length | Keys tried | Practicality |
|---|---|---|
| 1 byte | 256 | Instant |
| 2 bytes | 65,536 | Fast |
| 3 bytes | 16.7 million | Seconds to minutes |
| 4 bytes | 4.3 billion | Impractical — use the cryptanalysis tab instead |
The show only printable results filter hides candidates that decode to control characters, which typically removes well over 90% of the noise. Progress is reported live and the search can be cancelled at any point. When you spot the right plaintext, apply that key straight into the Encrypt/Decrypt tab with one click.
The important lesson from that table: brute force does not scale. Beyond about three bytes, guessing keys is the wrong approach entirely — and it is unnecessary, because repeating-key XOR can be broken without searching the keyspace at all.
This is the tab that matters for real challenges. Repeating-key XOR (sometimes called Vigenère XOR) falls to a two-stage attack that costs nothing like exhaustive search.
Assume a key length n, split the ciphertext into n columns by taking every n-th byte, and measure the Index of Coincidence within each column. If n is correct, every byte in a column was encrypted with the same key byte, so the column is a simple single-byte XOR of natural-language text and its IC lands near 0.067 (the value for English). If n is wrong, the column is effectively random and its IC sits near 0.038. The tool tests every length from 1 to 16 and ranks them by confidence.
Once the length is known, the problem collapses into n independent single-byte XOR problems — and each of those has only 256 possibilities. Solving them separately and reassembling gives the full key. A 16-byte key that would need 25616 guesses by brute force falls to 16 × 256 = 4,096 tests. The repeating-key solver does both steps in one action: leave the key length on auto and it detects the length, solves each column, and reports the recovered key in both text and hex, along with the decrypted plaintext. It needs at least 20 bytes of ciphertext; more is better, since the statistics get sharper with length.
When you can guess a fragment of the plaintext — a header like MZ, a word like flag{, or a common HTTP string — you can recover key material directly. Because plaintext XOR ciphertext = key, sliding your guessed crib along the ciphertext and XOR-ing at each offset produces a candidate key fragment at every position. The correct offset is the one where the recovered fragment is itself readable. The crib drag feature automates the slide and flags positions producing printable key material; the known-plaintext attack takes a matching plaintext and ciphertext pair and returns the key directly.
Candidate scoring uses a chi-squared comparison against expected letter frequencies. English is the default, but the tool also carries frequency tables for French, German, Spanish, Italian, and Portuguese — switch language if your target text is not English, or the top-ranked candidate will be wrong even when the attack itself succeeded.
A repeating-key XOR scheme leaks structure in several ways at once: identical plaintext blocks aligned to the key produce identical ciphertext blocks; the ciphertext preserves plaintext length exactly; and, as shown above, the key can be recovered from ciphertext alone with modest computation. XOR provides no authentication either, so an attacker who knows any plaintext can flip arbitrary bits in the corresponding ciphertext and control the decrypted result exactly.
The one XOR construction that is genuinely unbreakable is the one-time pad: a key that is truly random, at least as long as the message, and never reused. Reuse a one-time pad even once and the two ciphertexts XOR together to cancel the key, exposing the XOR of the two plaintexts. For anything real, use AES. Use XOR for CTFs, for obfuscation analysis, for understanding stream ciphers, and for reversing the lazy encoding layer someone wrapped around a payload.
Related tools: try the cipher identifier if you are not yet sure what scheme you are looking at, the one-time pad tool for the provably secure version of the same operation, the Caesar cipher decoder for shift ciphers, and the encoding chain analyzer when a payload has been wrapped in several layers of Base64, hex, and XOR together.
This XOR decoder gives you three escalating ways to recover plaintext when you do not have the key.
When the ciphertext was XORed against a single repeating byte, there are only 256 possible keys. The tool tries all of them, decodes each candidate, and ranks the results by an embedded English-frequency score so the readable plaintext floats to the top. This is the fastest way to decode classic single-byte XOR obfuscation (very common in malware string hiding and beginner CTF challenges).
Longer keys cannot be brute forced exhaustively — a 6-byte key already has 281 trillion possibilities. Instead the tool uses the classic break-repeating-key-XOR attack:
The result panel shows the recovered key in both text and hex with copy buttons, plus the full decrypted plaintext — one click applies it in the Encrypt/Decrypt tab.
If you know a word or fragment that appears somewhere in the plaintext — a "crib" such as the , GET /, or flag{ — you can slide it across every offset of the ciphertext. At each position, crib XOR ciphertext reveals a candidate key fragment. Printable fragments are highlighted because they are the likely real key bytes, letting you reconstruct the key piece by piece even when frequency analysis alone is ambiguous.
XOR is its own inverse: (plaintext XOR key) XOR key = plaintext. Because the same operation encrypts and decrypts, and because short or reused keys leak statistical structure, XOR ciphertext is highly recoverable through frequency analysis, brute force, and known-plaintext attacks. This is exactly why XOR alone is unsuitable for real security — use AES-256 or ChaCha20 for that — but it is also why XOR is a perfect teaching ground for cryptanalysis.
Privacy: every operation here — encrypt, decrypt, brute force, repeating-key recovery, and crib-drag — runs entirely in your browser. No ciphertext, key, or plaintext is ever uploaded.
If the key is one byte, use the Brute Force tab — all 256 keys are tested instantly and ranked by how English-like the result is. If the key repeats over a longer ciphertext, use the repeating-key solver in the Cryptanalysis tab, which detects the key length by Index of Coincidence and then solves each key byte independently.
Yes. XOR is its own inverse, so applying the same key to ciphertext returns the plaintext. That is why the tool has a single Encrypt/Decrypt tab.
Input and output can each be plain text, hexadecimal, or Base64, chosen independently. Keys can be text, hex bytes, or a single byte value.
One-byte keys are instant (256 candidates). Two bytes is 65,536 and still fast. Three bytes is 16.7 million and takes seconds to minutes. Four bytes is 4.3 billion and is not a realistic approach — switch to the repeating-key solver, which does not search the keyspace at all.
Sliding a guessed plaintext fragment along the ciphertext and XOR-ing at every offset. Since plaintext XOR ciphertext equals key, the correct offset yields readable key material. It is the standard technique when you know something about the plaintext, such as a file signature or a flag prefix.
At least 20 bytes for the analysis to run, but statistical attacks improve sharply with length. A good rule of thumb is several times the key length per key byte — a 100-byte ciphertext with an 8-byte key gives roughly 12 bytes per column, which is usually enough to converge.
Usually the input format is wrong — hex parsed as text, or Base64 parsed as hex — or the key format does not match how the key was originally supplied. Check the printable indicator: if the output is non-printable across the board, the key or format is off.
No, not with a short or repeating key. It has no authentication and its key is recoverable from ciphertext alone. Only the one-time pad variant — truly random key, at least as long as the message, never reused — is secure, and it is impractical for most uses. For real encryption use AES.
No. Encryption, brute force, frequency analysis, key-length detection, and crib dragging all execute locally in JavaScript and a Web Worker. Your ciphertext is never transmitted.
Yes — the tool can encode your current input and settings into a permalink, so you can send a colleague or teammate the exact state you are looking at.
Auto-detect cipher types from ciphertext using frequency analysis and pattern matching.
Theoretically unbreakable cipher with random key generation. XOR encryption with perfect secrecy.
Detect and decode nested encodings like Base64, Hex, URL encoding, ROT13.
Polyalphabetic cipher with Kasiski examination, Index of Coincidence analysis, key recovery tools, and interactive Tabula Recta visualization.
Multi-technique deobfuscation tool for malware analysis with auto-detection, XOR brute force, Base64, Hex, ROT13, URL decoding, and chaining capabilities.
Free online ROT13 and Caesar cipher decoder/encoder. Decode ROT13 instantly, crack Caesar ciphers with brute force solver, or encode with custom shifts (1-25).