You are reading a forum thread about a mystery novel and someone posts "Gur ohgyre qvq vg." It looks like nonsense, and that is the point. It is ROT13, a simple letter rotation used to hide spoilers, puzzle answers and punchlines from anyone who has not chosen to read them.
This guide explains how ROT13 works, why the same operation both hides and reveals text, where it is still used, why it offers no security at all, and how the related variants ROT47, ROT5 and ROT18 differ.
How ROT13 works
ROT13 stands for "rotate by 13 places". Each letter of the Latin alphabet is replaced by the letter 13 positions later, wrapping around from Z back to A:
Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
ROT13: N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
So "HELLO" becomes "URYYB", and lowercase letters rotate the same way. Digits, spaces, punctuation and accented letters stay unchanged, which is why ROT13 text keeps its shape and word lengths.
Why it decodes itself
The alphabet has 26 letters, and 13 is exactly half of 26. Rotating by 13 and then by 13 again adds up to 26, a full circle, which lands every letter back where it started. That makes ROT13 its own inverse: the same operation encodes and decodes. There is no separate "decrypt" step and no key to remember.
ROT13 is a special case of the Caesar cipher, which shifts letters by any fixed amount. For shifts other than 13, you need to shift back by the same amount to decode. Our guide to the Caesar cipher covers the general case and how to crack it.
The ROT family
| Variant | What rotates | By how much | Example |
|---|---|---|---|
| ROT13 | Letters A-Z, a-z | 13 of 26 | Call 555 → Pnyy 555 |
| ROT5 | Digits 0-9 | 5 of 10 | Call 555 → Call 000 |
| ROT18 | Letters and digits | ROT13 + ROT5 | Call 555 → Pnyy 000 |
| ROT47 | All printable ASCII from ! to ~ |
47 of 94 | Scrambles letters, digits and symbols |
Each variant rotates by exactly half the size of its character set, so each one is also self-inverse. ROT47 is the most thorough at making text unreadable at a glance, because digits and punctuation change too, but it also turns ordinary sentences into strings full of symbols that some systems handle badly.
Where ROT13 is used
ROT13 became popular on Usenet discussion groups as a polite way to hide content that some readers might not want to see, such as spoilers or answers to riddles. The reader had to take a deliberate step to decode it. The same convention survives today in:
- Spoilers in forums, reviews and comment threads.
- Puzzle and geocaching hints, where the hint is visible but not accidentally read.
- Programming exercises, as a first lesson in character codes and modular arithmetic.
- Light obfuscation, such as hiding a joke's punchline or keeping search engines from matching a phrase.
Encode or decode ROT13 in your browser
Our ROT13 Encoder / Decoder converts live as you type and supports all four variants.
- Open ROT13 Encoder / Decoder and paste text into Plain or encoded text. The Sample mixes plain and ROT13 text so you can see both directions at once.
- Choose the variant: ROT13, ROT47, ROT5 (digits) or ROT18. A short note under the tabs explains what each one changes.
- Read the result in the output box, which is labelled with the chosen variant, such as ROT13 result.
- To decode, paste the encoded text into the same box with the same variant selected. Because each rotation is self-inverse, there is no separate decode mode.
- Click Copy or Download to keep the result.
Other ways to apply ROT13
Command line
On macOS and Linux, tr does ROT13 in one line:
echo "Hello" | tr 'A-Za-z' 'N-ZA-Mn-za-m'
ROT47 is also possible with tr using the character ranges '!-~' 'P-~!-O'. This is the most convenient option if you are already in a terminal.
Programming languages
Python includes a ROT13 codec: codecs.encode("Hello", "rot13"). In other languages, a short loop over character codes works, and writing one is a classic beginner exercise.
Built-in features
Some email clients and text editors have historically offered ROT13 commands, and some forums have spoiler tags that hide text behind a click instead. Spoiler tags are usually friendlier for readers than ROT13 if your platform supports them.
Tips and misconceptions
ROT13 is not encryption
Anyone can decode ROT13 instantly, and its patterns are recognisable (common words such as "the" always become "gur"). Never use it, or any ROT variant, to protect passwords, personal data or anything confidential. For real protection, use proper encryption such as AES; our AES Encryption tool is a starting point, and Base64 is also not encryption, only an encoding.
Applying it twice does nothing
A common mistake is encoding text that was already encoded, which simply restores the original. If your output looks like plain English when you expected gibberish, the input was probably already ROT13.
Non-English letters are untouched
Letters such as é, ß or ñ, and characters from other scripts, are not rotated by ROT13. Text in other languages may therefore stay partly readable.
Numbers stay visible in ROT13
If a spoiler includes a number, such as "the killer lives at number 42", ROT13 leaves 42 visible. Use ROT18 or ROT47 when digits also need hiding.
Frequently asked questions
What is ROT13?
ROT13 is a letter substitution that replaces each letter with the one 13 places later in the alphabet, wrapping from Z to A. It is used to hide spoilers and puzzle answers from casual reading.
How do I decode ROT13?
Apply ROT13 again. Because 13 is half of 26, rotating twice returns every letter to its original position, so the same tool or command both encodes and decodes.
Is ROT13 secure?
No. It has no key and can be reversed by anyone instantly. It is only meant to prevent accidental reading, not to protect information.
What is the difference between ROT13 and ROT47?
ROT13 rotates only the 26 letters. ROT47 rotates all 94 printable ASCII characters, so digits and punctuation are scrambled as well.
Does ROT13 change numbers?
No. ROT13 leaves digits unchanged. ROT5 rotates digits only, and ROT18 combines ROT13 and ROT5 to change both letters and digits.