ROT13 Cipher
How it works
ROT13 (Rotate by 13) is a Caesar cipher with a shift value of 13 applied to the Latin alphabet. Because the alphabet has 26 letters, ROT13 is its own inverse — applying it twice returns the original text. ROT13 was used on early internet newsgroups and forums to obscure spoilers, punch lines, and mildly offensive content without requiring a key or password.
**How it works** Each letter is replaced by the letter 13 positions forward in the alphabet (wrapping around). A→N, B→O, C→P, ..., M→Z, N→A, O→B, ..., Z→M. Non-alphabetic characters (digits, spaces, punctuation) are left unchanged. "Hello, World!" becomes "Uryyb, Jbeyq!" and ROT13 again returns "Hello, World!".
**ROT13 is NOT encryption** ROT13 provides zero confidentiality against any adversary — it's trivially reversible and has been universally known since the 1980s. Its value is purely social: marking content as "deliberately obfuscated" without a password. Anyone who wants to read it can do so instantly. This distinguishes ROT13 from actual ciphers.
**Historical Caesar cipher** Julius Caesar used a shift of 3 (ROT3) for military communications: A→D, B→E, etc. It provided minimal security even then because the shift value was the only secret. With 26 possible shifts (25 useful ones), brute-force takes 25 attempts — trivial. ROT13 with shift 13 is special only because of its self-inverse property.
**Usages today** ROT13 appears in: crossword puzzle answers printed upside-down or encoded; spoiler tags in online communities; placeholder obfuscation in software (not for security, just to avoid accidental reading); and teaching substitution cipher concepts in cryptography courses.
Privacy: all encoding runs in the browser. No text is transmitted.
Frequently Asked Questions
- ROT13 shifts each letter by 13 positions. The English alphabet has 26 letters. Applying ROT13 twice gives a total shift of 26 ≡ 0 (mod 26) — which returns every letter to its original position. This works only with a shift of exactly 13 because 13 + 13 = 26. No other shift value (1–25) is its own inverse. ROT7 applied twice shifts by 14, not 26. ROT13's self-inverse property means the same operation encodes and decodes — no mode switch needed.
- Before ROT13 became the Usenet convention in the 1980s, spoiler etiquette required burying the spoiler text deep in a reply, using long lines of dashes as warnings, or relying on subject line warnings like '[SPOILER]'. ROT13 became the standard because it was simple enough to implement as a text processing command (`tr 'A-Za-z' 'N-ZA-Mn-za-m'` in Unix), visually unreadable at a glance, yet trivially decodable by anyone who wanted to read it. Most USENET clients added ROT13 decode buttons directly.
- ROT13 appears in: (1) Reddit's spoiler tag implementation (older mobile apps). (2) Some puzzle games and ARGs (alternate reality games) use ROT13 as an introductory cipher layer. (3) The Unix/Linux `tr` command is commonly taught with ROT13 as an example. (4) Software obfuscation (not for security, but to avoid string literals being obvious in binary files — e.g., magic strings in malware detection evasion). (5) Programming challenge sites use it as a teaching exercise for string manipulation.
- Caesar cipher: any shift value (ROT13 is Caesar with shift=13). ROT5: applies to digits only (0–4 → 5–9, 5–9 → 0–4), a digit-only version that's also self-inverse. ROT18: applies ROT13 to letters and ROT5 to digits simultaneously. ROT47: extends rotation to the 94 printable ASCII characters (33–126), shifting by 47, also self-inverse. Atbash: maps A↔Z, B↔Y, C↔X — a reflection rather than a rotation, but similarly trivial.