XOR Calculator
Calculate XOR using Hex or UTF-8 input and a known repeating key. Inspect result bytes and text with this browser-based learning tool.
Conversion workspace
Key bytes repeat across the input. The key cannot be empty.
Input, keys and output stay in this page and are cleared on reload.
Examples and how it works
XOR produces 1 when two bits differ. This tool repeats your key bytes across the input. Applying the same key again restores the original bytes.
Input: Hex · key: Hex 01
- Input
- 40 43 42
- Output
- ABC
Input: UTF-8 · key: Hex 01
- Input
- ABC
- Output
- @CB
Choose the input and key formats separately. Hex key “01” is one byte; UTF-8 key “01” is two character bytes and gives a different result. Keys must be 1–1024 bytes. Unknown keys are not recovered automatically.
How to use
- 1
Choose input and key formats
Select Hex or UTF-8 independently for the input and the key.
- 2
Enter a known key and data
Enter a 1–1024-byte key and the input, then press Convert. Key bytes repeat from the beginning.
- 3
Inspect text and Hex
Check the resulting text and Hex bytes. Bytes remain available even if they cannot be decoded as UTF-8.
Features
- Independent Hex and UTF-8 formats
- Repeating keys of 1–1024 bytes
- Text and Hex result views
Use cases
Learning data representations
Transform original samples to learn data representations.
Details
Input is limited to 1 MiB measured as UTF-8. Input and output are processed in this page, are not uploaded or saved, and disappear on reload.
Keys are not uploaded or saved. Key bytes repeat with the first key byte aligned to the first input byte.
FAQ
How do I reverse XOR?
Apply the same key to the result bytes again, using the same format, repetition and starting position.
Can I decode without knowing the key?
This calculator requires a known key. It does not perform automatic key recovery or brute force.
Are Hex 01 and text 01 the same key?
No. Hex 01 is one byte. UTF-8 text 01 is two bytes, 30 31.
Related Tools
Caesar Cipher & ROT13
Explore Caesar shifts and ROT13 with case-preserving letter conversion. Learn substitution with worked examples, entirely in your browser.
Password Generator
Generate secure passwords for free. Customize length and character sets.
Hash Generator
Compute SHA-1, SHA-256, SHA-384 or SHA-512 hashes of text or files in your browser. Handy for verifying file integrity and downloads.
All processing happens in your browser. Your files are never uploaded.
Did you know?
XOR with the same key twice restores the original bytes: a XOR k XOR k = a.