Toolstia / XOR cipher tool
XOR cipher tool
XOR is the simplest way to scramble data: each byte is combined with a byte of a key. Enter text and a key to get hex or Base64 output, or paste XOR output with the same key to read the text again.
Each byte of the text is combined with a byte of the key, repeating the key as needed. Running the same key again undoes it. A repeating-key XOR is easy to break, so this is for learning and puzzles, not for protecting secrets.
How it works
- Choose the direction and the output format.
- Enter the key and the text or encoded bytes.
- Copy the result.
How it works
Each byte of the text is XORed with a byte of the key. The key repeats if the text is longer. XOR is its own opposite, so the same key undoes it.
UTF-8
Text is turned into UTF-8 bytes first, so accents and other languages work and decrypt back correctly.
Weak by design
A short repeating key can be found from the data with simple analysis. A one-time pad is secure only if the key is truly random, as long as the message and never reused.
Wrong key
If the key is wrong, the output is usually unreadable bytes, which the tool shows as hex instead of text.
Questions
Is this safe for secrets?
No. Use it for puzzles, learning and simple obfuscation only. Everything happens in your browser, and nothing you enter is sent anywhere.
Why hex or Base64?
XOR output often contains bytes that are not printable characters, so it is shown in a form you can copy safely.
Can I use a number as a key?
Yes, but it is used as text, so the key 12 is the two characters 1 and 2.