#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⊕ FREE · TEXT · HEX · BASE64

XOR Cipher Tool: Encrypt and Decrypt With a Repeating Key

Combine data with a key byte by byte, and reverse it with the same key.

  • 🔁 Same key decrypts
  • 🔢 Text, hex or Base64 input
  • 🧾 Hex or Base64 output

How to use the XOR Cipher Tool

  1. 1. Enter the inputType text, or paste hex or Base64 data.
  2. 2. Enter the keyType a text key or a hex key; it repeats as needed.
  3. 3. Pick the outputGet hex, Base64 or readable text, and copy it.

How XOR encryption works

XOR (exclusive or) compares bits: the result is 1 when the bits differ and 0 when they match. Its key property is that (A ⊕ K) ⊕ K = A, so XOR-ing with the same key twice returns the original. A repeating-key XOR cipher applies the key bytes in turn across the message.

Worked example: "Hello" is 48 65 6c 6c 6f in hex, and the key "K" is 4b. 48 ⊕ 4b = 03, 65 ⊕ 4b = 2e, 6c ⊕ 4b = 27 (twice) and 6f ⊕ 4b = 24, so the result is 032e272724. Feed that back in as hex with the same key and you get Hello.

Strength and real uses

  • Weak with short keys: a repeating key can be broken by guessing its length and doing frequency analysis on each position, a classic exercise in cryptography courses.
  • Perfect with a one-time pad: a truly random key as long as the message, never reused, cannot be broken.
  • Inside real ciphers: stream ciphers and AES modes like CTR and GCM XOR the data with a key stream made by a strong algorithm.
  • Malware analysis: simple XOR is often used to hide strings in malicious files.

Output is hex by default because XOR results are usually not printable text. Choose text output only when you are decrypting back to readable text. Everything runs in your browser. Inspect the raw bytes with the hex dump viewer, or use proper encryption with the AES text encryption tool.

Frequently asked questions

Why is my output not readable?

XOR usually produces bytes outside the printable range. Use hex or Base64 to store or share it.

Can I use a hex key?

Yes. Choose Hex as the key format and enter pairs such as 4b or 1f2e3d.

Is the XOR Cipher Tool free?

Yes, the XOR Cipher Tool is free. The first time you see your first result, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.

More free tools

See all free tools