Productivity and Utilities

Repeating-Key XOR Tool

XOR data with a repeating key, or paste ciphertext to look for the key.

Your numbers

What to do

Example text. To find a key, paste ciphertext as hex (at least 40 bytes of English text works best).

Example key, in the same format as the data. It repeats along the data.

Result

Result in hex

0b3637272a2b2e63622c2e69692a23693a2a3c6324202d623d63343c2a26226324272765272a282b2f20

Result as text (dots for unreadable bytes)
ยท67'*+.cb,.ii*#i:*<c$ -b=c4<*&"c$''e'*(+/
Result in Base64
CzY3JyorLmNiLC5paSojaToqPGMkIC1iPWM0PComImMkJydlJyooKy8g
Data bytes
42
Key bytes
3
How this was calculated
  1. Each data byte is XORed with the key byte at the same position, and the key starts over when it runs out. XOR flips the bits where the key has a 1.
  2. Doing it twice with the same key returns the original, so the same step encrypts and decrypts. Switch the data format to hex to feed a result back in.
  3. Repeating-key XOR is a puzzle cipher, not real protection: patterns in the key show through, as the Find the key mode demonstrates.
  • Do not use XOR with a short key to protect anything that matters.

Calculated using SumPanda.com · https://sumpanda.com/repeating-key-xor-tool/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the repeating-key xor tool

  1. Choose XOR with a key to encrypt or decrypt, or Find the key to look for the key in ciphertext.
  2. Choose whether the data (and the key) are written as text or as hex digits.
  3. To XOR, enter the data and the key. The key repeats along the data, so a 3 byte key is used byte 1, 2, 3, 1, 2, 3 and so on.
  4. To find a key, paste the ciphertext as hex, set the longest key to try, and read the most likely key and the decrypted text.

Formula

output[i] = data[i] XOR key[i mod key length]

distance(size) = average bit difference between neighboring blocks of that size, per key byte

score = average of -ln(chance of each byte in English text)

XOR gives 1 where two bits differ and 0 where they match, and doing it twice with the same key returns the original. English letters share many bits, so with the right key size neighboring blocks differ less than random bytes do.

Two well known puzzles

XORing the line Burning 'em, if you ain't quick and nimble with the key ICE gives the hex string starting 0b3637272a2b2e63622c2e69692a23693a2a3c63. With hex input, XORing 1c0111001f010100061a024b53535009181c with the hex of "hit the bull's eye" gives "the kid don't play".

For the finder, the example ciphertext is an English paragraph of 220 bytes encrypted with the key orange. The page checks key sizes up to 40, finds that size 6 fits best, solves each of the 6 key bytes and reports orange together with the decrypted paragraph.

How the key is found

First the key size is estimated: for each size the data is cut into blocks and the average number of differing bits between neighbors is measured. Then, for the best few sizes, the bytes at the same key position are grouped, and for each of the 256 possible key bytes the page asks how English the group would look (letter and space frequencies). Multiples of the true size always fit slightly better, so the shortest key within a small margin of the best score is reported.

This works on plain English of a few dozen bytes per key byte or more. It can fail on short, repetitive, non-English or non-text data. It is a statistical guess, so read the decrypted text before trusting it.

Why this is not encryption

A short key repeated along a message leaks its pattern, which is exactly what the finder uses. For real protection use a modern cipher. The Vigenere Cipher Tool shows the letter based version of the same idea, and the Bitwise Calculator lets you try XOR on single numbers.

Assumptions and limits

  • Text is read as UTF-8 bytes and hex may contain spaces, colons and 0x.
  • Finding a key needs at least 20 bytes of ciphertext and twice the longest key size to try.
  • The scoring expects mostly lower case English; other languages and data will usually fail.
  • At most 20,000 bytes are processed at once and the longest key to try is 64.
  • Bytes that are not printable are shown as a middle dot in text output.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

Why does the key finder sometimes return a longer key than I used?

If the text is short, a key twice as long fits a little better by chance. The page prefers the shortest key within a small margin, but a very short message can still fool it.

Can I decrypt with the key if I only know the text?

Yes. Switch to hex for both, enter the ciphertext as data and the key as hex, and XOR them.

What does the English score mean?

It is the average surprise of each byte if the text were English. About 2.5 to 3.5 is common for English prose and 8 or more is what random bytes give.

Is a repeating-key XOR ever safe?

Only if the key is as long as the message, random and never reused, which is a one-time pad. A short repeating key is not safe.