XOR Cipher & XOR Calculator
XOR text, hex or Base64 with a repeating key, XOR two hex strings, or brute-force a single-byte XOR key ranked by English score. Hex, Base64 and text output.
The 1-byte key repeats over the 5 bytes. A short repeating key is easy to break; XOR is only secure as a one-time pad (a truly random key as long as the data, never reused).
XOR is its own inverse: XOR the output with the same key to get the input back.
Exclusive-or (XOR) is the building block of stream ciphers and one-time pads, and a favourite of malware authors and capture-the-flag puzzles. This tool XORs text, hex or Base64 data with a key that repeats as needed, XORs two equal-length hex strings, or tries all 256 single-byte keys and ranks the results by how English they look. Output comes as hex, Base64 and readable text.
How to use this tool
- Choose a mode: XOR with a key, XOR two hex strings, or brute-force a single-byte key.
- Paste the data and say whether it is text, hex or Base64.
- Enter the key as hex, text or decimal byte values (not needed for brute force).
- Copy the hex, Base64 or text result; XOR it again with the same key to undo it.
Formula
Cᵢ = Pᵢ ⊕ K(i mod k) and Pᵢ = Cᵢ ⊕ K(i mod k)
Pᵢ is byte i of the data and K the key of k bytes. Each output bit is 1 where the two input bits differ. Because x ⊕ k ⊕ k = x, encryption and decryption are the same operation. Brute force scores each of the 256 results with English letter frequencies plus a bonus for spaces.
Example
The text Hello (48 65 6c 6c 6f) XOR the single key byte 0x20 gives 68 45 4c 4c 4f — hELLO, because 0x20 is the bit that separates upper and lower case. The hex string 1c0111001f010100061a024b53535009181c XOR 686974207468652062756c6c277320657965 gives 746865206b696420646f6e277420706c6179, which reads "the kid don't play".
Frequently asked questions
Is XOR encryption secure?
Only as a one-time pad: a truly random key as long as the message, used once. A short repeating key can be broken with frequency analysis, and reusing any key lets an attacker XOR two ciphertexts to cancel it.
Why does the text output show \x codes?
XOR usually produces bytes that are not printable text. They are shown as \xNN so nothing is hidden; use the hex or Base64 output to copy the exact bytes.
How does the single-byte brute force decide?
Every key from 0x00 to 0xFF is tried and the output scored by English letter frequencies, with points for spaces and penalties for control characters. With fewer than about 20 bytes the best guess can be wrong, so check the table.
Sources
Last updated:
Page address with these inputs: https://kakao.mobile/tools/xor-cipher-tool/
Cite or embed this tool
kakaoCalc. (2026, November 8). XOR Cipher & XOR Calculator. https://kakao.mobile/tools/xor-cipher-tool/
“XOR Cipher & XOR Calculator.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/xor-cipher-tool/.
Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms