ROT13 by hand: why one rule both hides and reveals a spoiler
ROT13 is the Caesar cipher with the shift fixed at 13. It has been used for decades to hide spoilers and punchlines on forums, not to protect anything secret, because anyone can reverse it in seconds. What makes it neat is a piece of arithmetic: the alphabet has 26 letters and 13 is exactly half of 26.
Why encoding and decoding are the same step
Shift a letter forward by 13 and you land halfway around the alphabet. Shift again by 13 and you complete the lap. So applying ROT13 twice returns the original text, which means you never need a separate "decode" rule. Mathematicians call this a self-inverse operation.
A worked example
Encode the spoiler The butler did it.
- T is the 20th letter. 20 + 13 = 33, and 33 - 26 = 7, which is G.
- h is the 8th letter. 8 + 13 = 21, which is u.
- e is the 5th letter. 5 + 13 = 18, which is r.
- Continue letter by letter, leaving the spaces alone.
The finished result is Gur ohgyre qvq vg. To decode it, run exactly the same procedure: G (7) + 13 = 20, which is T, and so on, until you are back at the original sentence.
Try one more on your own: Hello, World becomes Uryyb, Jbeyq. Notice the comma and capital letters stay where they were. Only A to Z and a to z move.
Common mistakes
- Forgetting to wrap around. After the 13th letter M, the next letters start again at A. N becomes A, not a symbol past Z.
- Expecting ROT13 to touch digits or punctuation. Standard ROT13 changes letters only. A related variant, ROT5, rotates the digits 0 to 9 by five places, and ROT47 rotates a wider range of printable ASCII symbols. They are separate rules, so do not mix them in one step.
- Treating it as security. ROT13 has only one possible key. It is a courtesy veil for casual readers, not encryption you should rely on.
- Applying it twice by accident. If your decoded output looks scrambled, check whether the text was already decoded once.
Check it in a tool
The ROT13 encoder and decoder on caesarcipher.org converts text as you type, offers ROT47, ROT5, ROT18, ROT25 and a custom shift, and includes a reference grid showing which letter maps to which. Paste the ciphertext above and you should get the original sentence back. If you want to see how the same idea generalises to other shifts, the caesarcipher.org homepage is a good starting point.
Published by the caesarcipher.org team; drafted with AI assistance.