XOR Brute Force Cracker
Try every single-byte XOR key, analyse repeating keys, or recover key bytes from known plaintext, with ranked candidates and byte-by-byte explanations.
Exhaustive single-byte XOR search
All 256 keys are checked; the most English-like plaintexts rank first.
Ciphertext Input
Selected plaintext candidate
Preview: up to 8,000 bytes. Copy plaintext (hex) preserves the full recovered bytes.
Ranked Candidates No results
Load a sample or paste encrypted bytes, then select Crack ciphertext. Candidates will be ranked here.
Candidates are ranked by English-language patterns. The percentage shows printable ASCII bytes in the scored sample (up to 4,096 bytes), not confidence that a key is correct.
About This Tool
The highest-ranked result is a candidate, not a guaranteed solution. Repeating-key recovery uses statistical guesses rather than exhaustive search. A truly random, secret one-time pad used only once cannot be recovered using these methods.
Using This Tool: Guide & Notes Show guide
The XOR Brute Force Cracker compares possible XOR keys and plaintexts. Single-byte mode tests all 256 byte keys; repeating-key mode makes statistical guesses; known-plaintext mode derives key bytes from a supplied fragment.
How to use it
- Choose Single-byte, Repeating-key or Known plaintext. Select the input format, then paste ciphertext or use Load example for a matching sample.
- Choose Crack ciphertext to run the analysis. Repeating-key analysis shows progress and can be cancelled; editing the input or changing modes also cancels the current run and clears outdated results.
- Select a ranked candidate to inspect its key, plaintext preview and the first eight byte-by-byte XOR calculations.
- Copy the key in hexadecimal, copy the visible plaintext preview, or use Copy plaintext (hex) to preserve every recovered byte. Unresolved key bytes cannot be exported as complete plaintext.
Options and settings
- Hexadecimal accepts complete byte pairs with spaces, commas, colons, semicolons, underscores or hyphens, and optional 0x prefixes. Base64 accepts standard or URL-safe input, with or without padding. UTF-8 text encodes exactly the text you enter as bytes.
- Single-byte mode tests keys 00–FF, including 00, and displays the best 12 candidates. Ranking uses English letter patterns and does not prove that the first result is correct.
- Repeating-key mode tests key lengths from 2 up to the selected maximum (2–32 bytes), limited by the amount of ciphertext. It also checks a single-byte candidate. At least 30 bytes are required; 200 or more bytes of ordinary English usually give better evidence.
- Known plaintext requires an exact fragment, its zero-based starting offset in bytes, and an assumed repeating-key length of 1–64 bytes. UTF-8 characters can occupy more than one byte. Incorrect assumptions can produce conflicts; uncovered key positions remain ?? and unresolved plaintext positions appear as dots.
- The percentage beside a candidate measures ASCII text and whitespace in a sample of up to 4,096 bytes. It is not a confidence score. The Hamming-distance chart supplies another clue about key length, not a guaranteed answer.
Notes
- All processing happens in your browser, with no ciphertext, plaintext or keys sent by the tool to a server. Decoded ciphertext is limited to 32 KiB; encoded input is limited to 262,144 characters.
- The plaintext preview covers at most the first 8,000 bytes and escapes control characters. Invalid UTF-8 can appear as replacement characters; use the full hexadecimal export when exact bytes matter. Partial known-plaintext recovery uses a byte-oriented display.
- Short, binary, compressed or non-English messages can rank poorly even when the correct key is among the candidates. Repeating-key analysis is heuristic and does not search every possible multi-byte key.
- These attacks do not recover a truly random, secret one-time pad used only once. Use the separate XOR Cipher tool when you already know the key and want to encrypt or decrypt directly.
XOR Brute Force: How to Crack an XOR Cipher Without the Key
Why 256 guesses can break single-byte XOR, how repeating keys reveal statistical patterns, and what known plaintext can tell you about a missing key.