ROT13 Encoder / Decoder

Apply the ROT13 letter-substitution cipher. Because it shifts by 13, the same action both encodes and decodes.

🔐

ROT13 Cipher

Text • cipher

0 chars
0 chars

How to Use the ROT13 Cipher

  1. Pick a direction — use the toggle at the top (e.g. encode vs decode).
  2. Type or paste your text — the result updates live as you type; large inputs are fine.
  3. Copy the result — one click copies the output to your clipboard.
  4. Swap — flip the direction (⇄) to reverse the conversion instantly.

Why Use This ROT13 Cipher

🎯

Reversible in one click

Encoding and decoding share the page, so any result can be pasted straight back to confirm it round-trips to the text you started with — the quickest check that nothing was mangled.

Live as you type

Results are recalculated on every keystroke, with no submit step and no page reload, so a value can be adjusted until the answer looks right rather than guessed once.

🔒

100% private

Everything runs in your browser — no account, no uploads, nothing leaves your device.

Understanding the ROT13 Cipher

ROT13 ("rotate by 13") is a simple substitution cipher that shifts each letter 13 places in the alphabet. Because the alphabet has 26 letters, applying ROT13 twice returns the original text — so the same action both encodes and decodes.

It is used to hide spoilers, puzzle answers and punch-lines in plain sight, not for real security. Type any text to scramble or unscramble it instantly, all in your browser.

Formula & Logic

ROT13 shifts each letter thirteen places through the alphabet, wrapping around at the end. Because thirteen is exactly half of twenty-six, the transformation is its own inverse — applying it twice returns the original text, so encoding and decoding are the same operation. It offers no security whatsoever and was never intended to: its purpose on early Usenet was to hide spoilers and punchlines from casual reading, requiring a deliberate act to reveal them. It is a Caesar cipher, breakable by inspection, and calling it encryption would be a category error.

For letters: new = ((old − base + 13) mod 26) + basebase = 65 for uppercase, 97 for lowercaseNon-letters pass through unchangedROT13(ROT13(x)) = x — self-inverse

where:

13
half of 26, which is what makes it self-inverse
base
the ASCII code of A or a, for wrapping within the correct case
passthrough
digits, punctuation and spaces are untouched

Assumptions: Provides no confidentiality and must never be used to protect anything. ROT47 extends the idea across printable ASCII including digits and punctuation, and is equally insecure.

Step-by-Step Example: Encoding "Attack" and Decoding It Back

Apply the shift letter by letter, then demonstrate the self-inverse property.

  • PlaintextAttack
  1. A is code 65. (65 − 65 + 13) mod 26 = 13, + 65 = 78, which is N.
  2. t is code 116. (116 − 97 + 13) mod 26 = 32 mod 26 = 6, + 97 = 103, which is g.
  3. The second t likewise becomes g.
  4. a → n, c → p, k → x.
  5. Result: Nggnpx.
  6. Apply ROT13 again to Nggnpx: N → A, g → t, g → t, n → a, p → c, x → k, giving Attack.

Result"Attack" becomes "Nggnpx" — and applying it again restores it

Note that case is preserved because each case uses its own base, and that the round trip is exact. The self-inverse property is the whole appeal: one function serves both directions, and no key needs to exist because there is no secret.

ROT13 Cipher FAQ

No — it is a simple letter rotation used to hide spoilers or puzzle answers, not for security. Encoding and decoding are the same operation.

Related Converters

✔ Written & reviewed by Dr Sam — 20+ yrs in management & research leadership📅 Last updated September 2026📚 Sources: NIST & BIPM SI unit definitions📑 How we build & check these

A Cipher Designed to Be Broken Instantly

ROT13 is a Caesar shift with the offset fixed at thirteen, and thirteen is exactly half of twenty-six. That single choice makes it its own inverse: applying it twice returns the original text, so one function both scrambles and restores, and no key needs to be stored or transmitted. It is the simplest possible reversible transformation of the alphabet, and its simplicity is the entire design.

The purpose was never secrecy but consent. On early Usenet groups it hid spoilers, punchlines and answers from readers scrolling past, while remaining trivially readable by anyone who chose to decode it. That is a social convention implemented in text rather than a security control, and treating it as protection for anything sensitive misunderstands what it was built for — the transformation is public and reversing it requires no information at all.

The scheme only touches the twenty-six letters of the basic alphabet, leaving digits, punctuation, accented characters and spacing untouched, which is why the shape of a ROT13 string is instantly recognisable. ROT47 extends the same idea across the printable ASCII range so that numbers and symbols are shifted too, at the cost of producing output that no longer looks like text at all.