XOR Cipher Tool
Encrypt or decrypt text with XOR using a text or hex key. Shows hex and base64 output, warns when the key is shorter than the plaintext.
Use the XOR Cipher Tool
Enter an even-length hex string, e.g. 2f4a9c
Key shorter than input — the key repeats.
A repeating key leaks ciphertext patterns that statistical analysis can break.
Use a key at least as long as the input for real security.
Invalid hex key — must be an even-length string of hex digits (0–9, a–f).
Output (text)
Hex
—
Base64
—
Summary
0
Input bytes
0
Key bytes
1
Key cycles
Sample inputs — click to load
Copied!
Summary
XOR encryption applies a bitwise XOR between each byte of your input and the key bytes, cycling the key when it is shorter than the input. This tool encrypts or decrypts text, displays results in hex and base64, and warns you when key reuse weakens security.
How it works
- Enter plaintext (or ciphertext to decrypt) in the input field.
- Type a key in text or hex format and select the matching mode.
- The tool XORs each input byte with the corresponding key byte, cycling the key.
- Hex and base64 representations of the result appear instantly.
- A warning highlights key reuse when the key is shorter than the input.
Use cases
- Demonstrate XOR encryption in a cryptography or security course.
- Quickly obfuscate short strings for non-sensitive local storage.
- Test CTF (capture-the-flag) challenges that use XOR with a repeating key.
- Illustrate why short, repeated keys are vulnerable to known-plaintext attacks.
Frequently Asked Questions
Last updated: 2026-06-19 · Reviewed by Nham Vu