Instantly transform any text using the classic ROT13 substitution cipher. Encode or decode messages with a single click. Perfect for hiding spoilers, creating puzzles, or exploring the fundamentals of cryptography. Works entirely in your browser — no data is sent to any server.
Instantly transform any text using the classic ROT13 substitution cipher. Encode or decode messages with a single click. Perfect for hiding spoilers, creating puzzles, or exploring the fundamentals of cryptography. Works entirely in your browser — no data is sent to any server.
ROT13 (short for "rotate by 13 places") is a simple letter substitution cipher that replaces each letter with the 13th letter after it in the alphabet. It is a special case of the Caesar cipher, which was used by Julius Caesar for military communications. Because the Latin alphabet has 26 letters, ROT13 is its own inverse: applying ROT13 twice returns the original text. This makes it a convenient tool for obfuscating text without any encryption key management.
ROT13 Transformation Rules
A → N | B → O | C → P | D → Q | E → R | F → S | G → T | H → U | I → V | J → W | K → X | L → Y | M → Z
N → A | O → B | P → C | Q → D | R → E | S → F | T → G | U → H | V → I | W → J | X → K | Y → L | Z → M
Non-alphabetic characters (digits, punctuation, whitespace) remain unchanged.
ROT13 is a monoalphabetic substitution cipher that operates on the 26 letters of the English alphabet. The transformation is defined mathematically as:
c' = (c + 13) mod 26 for letters a–z and A–Z
Where c is the position of the letter (0-indexed) and c' is the position of the substituted letter. Because 13 is exactly half of 26, the cipher is an involution: applying it twice yields the original plaintext. This property makes ROT13 incredibly simple to use — no separate decode function is needed, only a single transformation that works in both directions.
The cipher preserves case: uppercase letters map to uppercase, lowercase to lowercase. All non-alphabetic characters — including digits, punctuation marks, spaces, and newlines — are left untouched. This ensures that the structure and formatting of the original text remain intact, making it easy to read after decoding.
While ROT13 offers no cryptographic security by modern standards (it is easily broken by frequency analysis or brute force), it serves as an excellent pedagogical tool and a lightweight method for content obfuscation in casual contexts.
In large online forums and subreddits dedicated to movies, TV shows, and books, moderators often encourage users to encode spoilers using ROT13. For example, a user might post: Gur qba'g jva va gur raq. (which decodes to "The don't win in the end."). This allows readers to choose whether to view the spoiler, preserving the experience for those who wish to avoid it. The self-inverse nature of ROT13 means that the same tool can be used to both encode and decode, reducing friction for users.
Pro tip: Some browsers and extensions offer built-in ROT13 decoding, making it even easier for users to toggle spoilers on and off.
ROT13 is frequently used as an introductory exercise in programming courses and coding bootcamps. Students implement the cipher in languages like Python, JavaScript, and C++ to learn about string manipulation, character encoding, and modular arithmetic. The simplicity of the algorithm — a single shift and a modulo operation — makes it accessible to beginners while introducing key concepts like ASCII/Unicode handling and conditional logic. Many online coding platforms include ROT13 as a warm-up challenge before moving on to more complex cryptographic algorithms.
| Cipher | Shift / Key | Character Set | Self-Inverse | Common Use |
|---|---|---|---|---|
| ROT13 | 13 | A–Z, a–z | Yes | Spoilers, puzzles, education |
| ROT5 | 5 | 0–9 (digits) | No | Digit obfuscation |
| ROT47 | 47 | ASCII 33–126 | Yes | Broader text obfuscation |
| Caesar Cipher (shift 3) | 3 | A–Z, a–z | No | Classical encryption |
| Atbash | Reversal | A–Z, a–z | Yes | Hebrew/Ancient ciphers |
| Vigenère | Variable key | A–Z, a–z | No | Stronger classical encryption |