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.

Output (text)
Hex
Base64

Sample inputs — click to load

Copied!

Summary

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.

How it works

  1. Enter plaintext (or ciphertext to decrypt) in the input field.
  2. Type a key in text or hex format and select the matching mode.
  3. The tool XORs each input byte with the corresponding key byte, cycling the key.
  4. Hex and base64 representations of the result appear instantly.
  5. 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-07-01 · Reviewed by Nham Vu