XOR Cipher
Encrypt and decrypt text using XOR bitwise operations with any key string. XOR is its own inverse — apply the same key to encrypt and decrypt.
What Does This Tool Do?
XOR cipher encrypts each character by XORing its ASCII value with the corresponding key character value. Because XOR is its own inverse, the same operation with the same key both encrypts and decrypts.
Key Features
XOR Operation
Bitwise XOR of each character with key.
Self-Inverse
Same key encrypts and decrypts.
3 Output Formats
Hex bytes, decimal bytes or text.
Copy Result
One-click copy.
How to Use
- Enter the text to encrypt or decrypt.
- Enter a key string.
- Select output format.
- Click XOR Encrypt / Decrypt (same for both directions).
Frequently Asked Questions
How does XOR encryption work?▾
Each byte of the message is XORed with the corresponding byte of the key (cycling if key is shorter). XOR(XOR(x, k), k) = x, so the same operation decrypts.
Is XOR secure?▾
A single-character or short repeating key is easily broken with frequency analysis. XOR with a truly random key as long as the message is a One-Time Pad — theoretically unbreakable.
Why is hex output useful?▾
XOR results often produce non-printable characters. Hex format shows the byte values as readable two-digit codes regardless of printability.