ROT13 / Caesar Cipher
Encode or decode ROT13 and simple Caesar-shift text.
Overview
The ROT13 / Caesar cipher tool shifts each letter of the input by a fixed amount around the alphabet. ROT13 is the special case of a 13-position shift, which is its own inverse — encoding twice gets you back to the original. Pick any shift from 1 to 25 and the tool encrypts or decrypts accordingly.
It is the right tool for puzzles, spoiler hiding on forums, gentle obfuscation of throwaway text, and teaching the basics of substitution ciphers. ROT13 in particular is woven into Usenet culture and Stack Overflow tradition as a low-effort way to hide a joke punchline.
How it works
A Caesar cipher applies the same letter-shift to every alphabetic character: C = (P + k) mod 26, where P is the plaintext letter (A=0..Z=25), k is the shift, and C is the ciphertext letter. Decryption is P = (C - k) mod 26. ROT13 is the case k = 13, which is its own inverse because 26 mod 26 = 0 — applying it twice cancels out. Non-letter characters (digits, punctuation, whitespace) pass through unchanged, and case is preserved. The cipher predates 50 BC; it is named after Julius Caesar's reported use of k = 3 for military dispatches.
Examples
Plaintext: HELLO
Shift: 3
Output: KHOOR
Plaintext: HELLO
Shift: 13 (ROT13)
Output: URYYB
Plaintext: URYYB
Shift: 13 (ROT13 again)
Output: HELLO
Plaintext: Attack at dawn
Shift: 7
Output: Haahjr ha khdu
FAQ
Is ROT13 secure?
Not even remotely. It is a fixed substitution, breakable by inspection in seconds. Treat it as a "spoiler hide" mechanism, not encryption.
Why is ROT13 its own inverse?
Because 13 + 13 = 26 ≡ 0 (mod 26). Shifting by 13 twice lands you back where you started. ROT47 (shift by 47 over the printable ASCII range of 94 characters) shares the same self-inverse property.
How was the Caesar cipher broken?
Brute force — there are only 25 non-trivial shifts. An attacker tries all 25 and picks whichever output looks like a real language. Frequency analysis is overkill; a glance suffices.
What is ROT47 then?
A wider Caesar shift over printable ASCII (codes 33–126), shifting by 47. It scrambles symbols and digits too, but is just as easily broken.