What is ROT13?
ROT13 (“rotate by 13 places”) is a simple letter substitution cipher that replaces each letter with the letter 13 positions after it in the alphabet. It is a special case of the Caesar cipher with a fixed shift of 13.
Because the English alphabet has 26 letters, applying ROT13 twice returns the original text. This self-inverse property is why a single function both encodes and decodes ROT13 messages.
How ROT13 Works
Mapping (A↔N, B↔O, …, M↔Z):
Example:
Mathematical Formula
History and Common Uses
Origin
ROT13 became widely used on Usenet in the early 1980s. It was adopted as a community convention to obscure spoilers, punchlines, and offensive jokes — readers had to deliberately decode the text to view it.
Modern Usage
- Hiding spoilers and answers in online forums and puzzles
- CTF (Capture The Flag) challenges and beginner cryptography exercises
- Lightweight obfuscation in source code comments
- The Unix “tr” command and the Emacs
M-x rot13-regionshortcut
ROT13 Security
ROT13 provides no cryptographic security:
- The shift is fixed and publicly known (13).
- Letter frequencies are preserved — “E” in plaintext maps to “R”.
- Word lengths and patterns are unchanged.
- Treat it as obfuscation, not encryption.