XOR Cipher — Single-Byte Brute Force
XOR text or hex against a repeating key, view the result as hex and text, or brute-force a single-byte key by ranking all 256 candidates for printability.
Result appears here…
Result appears here…
Tries all 256 single-byte keys and ranks results by how printable they are — best guesses first.
Finds a key of up to 16 bytes that repeats over English text: the ciphertext is split into one column per key byte and each column is solved on its own. It needs the text to be many times longer than the key.
What an XOR cipher does
XOR (exclusive or) combines each byte of your input with a byte of the key. Type text or paste hex, enter a key as text or hex, and the tool shows the result in both hex and a printable-text view. The encoded pane can also write the bytes as Decimal bytes, Octal bytes or Latin-1 text, where a byte in the upper half reads as é or ß rather than a dot. Because XOR is symmetric, running the same key over the output again returns the original — so one tool both encrypts and decrypts. “Open a file…” takes a file of any type as its raw bytes and puts them in the input as hex, and “Download bytes” saves the XORed bytes as a file, named after the opened file with .xor added — or taken off again when it already ends in .xor, so a file XORed twice comes back under its own name.
Repeating-key XOR and single-byte brute force
Keys shorter than the data repeat cyclically, the classic repeating-key XOR. When a message was scrambled with a single-byte key, the brute-force button tries all 256 keys, scores each result by how printable it is, and lists the most likely plaintext first. Click a candidate to load its key and reveal the full decoded output. “Break repeating key” does the same for a longer key over English text, and also draws a “Probable key lengths” table: every length it tries, ranked by how often bytes in the same column coincide (the Coincidence column, a share of the best length’s), with the key each length guesses.
Frequently asked questions
Is XOR secure encryption?
No. XOR with a short or repeating key is easily broken and is meant for obfuscation, CTF puzzles, and learning — not for protecting sensitive data. Use AES or a modern cipher for real encryption.
Can I use a hex key or a text key?
Both. Switch the key field between Text and Hex. A text key is UTF-8 encoded, while a hex key lets you supply exact bytes such as 2a or de ad be ef.
How does single-byte brute force work?
It XORs your input against every value from 0 to 255, ranks each result by its ratio of printable characters, and shows the top candidates so the correct key usually rises to the top for readable text.
Can it break a key longer than a single byte?
Yes. “Break repeating key” finds a repeating key over English text and lists the likeliest candidates, each with a button to use it.
Can I XOR a whole file and save the result?
Yes. “Open a file…” reads a file of any type as the bytes it is, never through a text decoding, and puts them in the input as hex, switching Input to Hex; a file past the size limit is refused with both sizes named. Enter the key and “Download bytes” saves the XORed bytes as a binary file: photo.jpg comes out as photo.jpg.xor, and XORing that again with the same key saves photo.jpg. Typed input downloads as xor-output.bin.
Can I see the output as decimal or octal bytes, or as Latin-1?
Yes. Besides Hex, Base64 and Binary, the output format select offers Decimal bytes and Octal bytes, one number per byte with spaces between, and Latin-1 text, which shows each byte as its Latin-1 character, so a byte in the upper half reads as é or ß where the text pane shows a dot; control codes are still dots. Hex stays the default, and these three are for reading and copying only — input is never read in them.