Tools Hub

XOR Text with Key

XOR text bytes with a repeating key and get Base64, or reverse it.

Browser onlyYour data never leaves this device.

Runs entirely in your browser. Your text never leaves this device and is never stored.

Details: Privacy policy

Input

XOR is symmetric; encode and decode use the same operation.

Result

No text yet.

Paste text or a Base64 payload above.

XOR Text with Key applies the XOR operation byte by byte between the UTF-8 text and a repeating key, then returns the result as Base64; the same operation reverses it. It is a teaching and puzzle tool rather than a security tool: XOR is symmetric, fast and easy to implement, and with a short repeating key it is also easy to break. The page says that plainly instead of implying encryption. Encoding converts the text to UTF-8, repeats the key across those bytes and emits Base64, which keeps the output pasteable. Decoding reads Base64, applies the same XOR and interprets the bytes as strict UTF-8, so a wrong key usually produces an error rather than silent gibberish. The byte count is reported so the size of the operation is visible. It is the tool for a capture-the-flag exercise, a simple data-mangling step in a test fixture, and demonstrating why repeating-key XOR is not a substitute for authenticated encryption. Because the key repeats from the start of the byte stream, the same key and input always produce the same Base64, which makes the tool useful for reproducible fixtures but also demonstrates the pattern leakage. A longer random key would be closer to a one-time pad, but it would still need authentication to resist tampering. The output is deterministic for a given key, so a fixture can be regenerated exactly. Whitespace in the input is part of the bytes. Encoding then decoding with the same key restores the text. The Base64 output is plain text and can be pasted anywhere.

How to use XOR Text with Key

  1. Paste the text or Base64 payload.
  2. Enter a key and choose encode or decode.
  3. Copy the result or clear to start over.

What you get

  • Base64 of the XOR result when encoding.
  • The decoded UTF-8 text when decoding.
  • A byte count and a clear error for an empty key or invalid input.

When to use XOR Text with Key

  • Reverse a repeating-key XOR step in a puzzle or CTF exercise.
  • Mangle a test string deterministically with a known key.
  • Show why XOR is symmetric and why a repeating key is weak.

Frequently asked questions about XOR Text with Key

Is XOR encryption secure?

No. A repeating-key XOR is weak and patterns can leak; use the password tool with AES-GCM for real protection.

Why does decoding fail with the right key?

The Base64 may be malformed, or the XOR result may not be valid UTF-8. Check both.

Can the key be any length?

Yes, but a short key repeats more often and is easier to break.

Is my text uploaded?

No. XOR runs in your browser; nothing is sent to a server or stored.

Guides that compare XOR Text with Key

⚡Embed XOR Text with Key on Your Site & Get Badge↓

Embed this in-browser tool into any blog, documentation, or dashboard. Includes an optional dofollow backlink badge to credit Tools Hub.

Height:
<iframe src="https://salaq.com/embed/text/xor-text-with-key" title="XOR Text with Key — Tools Hub" width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden;max-width:100%;" loading="lazy"></iframe>
<p style="font-size:12px;color:#6b7280;margin-top:6px;font-family:system-ui,-apple-system,sans-serif;">Powered by <a href="https://salaq.com/tools/text/xor-text-with-key" target="_blank" rel="noopener" style="color:#2563eb;text-decoration:underline;">XOR Text with Key on Tools Hub</a></p>

Feedback

Send feedback about this tool (placeholder — feedback collection is not wired up yet).