XOR Cipher
Encrypt or decrypt bytes with a repeating XOR key, using text, hex, or Base64 input and output.
Input text
Output hex
Byte inspector
| # | Input byte | Key byte | Output byte | Output char |
|---|
Add valid input and a valid key to see how each input byte is XORed with the repeated key bytes.
Using This Tool: Guide & Notes Show guide
The XOR cipher combines input bytes with repeating key bytes. The same operation encrypts and decrypts when the same key is used.
How to use it
- Choose Encrypt or Decrypt. XOR uses the same byte operation in both directions.
- Select text, hex, or Base64 for the input, key, and output formats.
- Enter a key. The key bytes repeat across the full input.
- Use the byte inspector to confirm exactly which input byte and key byte create each output byte.
Options and settings
- Text format uses UTF-8 bytes before XOR is applied.
- Hex format is best for arbitrary ciphertext bytes that may not be readable text.
- Base64 format is useful when the XOR bytes need to travel as plain text.
- Group hex bytes and uppercase hex output only affect display.
Notes
- Repeating-key XOR is not secure modern encryption.
- A one-byte XOR key is especially weak and is mainly useful for demonstrations and puzzles.
Related Article
XOR Cipher: The Tiny Bit Operation Behind Real Cryptography
How one simple either-or rule turns text into bytes, bytes into ciphertext, and classical cipher thinking into the logic of stream ciphers, one-time pads, and modern encryption.