How ROT13 works
ROT13 replaces each letter with the one 13 places further along the 26-letter English alphabet, wrapping from Z back to A. Because 13 is exactly half of 26, applying it twice returns you to the start, which is why one button both encodes and decodes. It is the special case of the Caesar cipher with a shift of 13; Julius Caesar reportedly used a shift of 3.
The implementation touches only the 52 letters A-Z and a-z, keeps their case, and leaves everything else alone. It subtracts the base (65 for capitals, 97 for lower case), adds 13, takes the remainder after dividing by 26, and adds the base back.
| A-M | maps to | N-Z |
|---|---|---|
| A B C D E F G | ↔ | N O P Q R S T |
| H I J K L M | ↔ | U V W X Y Z |
Worked example
Hello, World!becomesUryyb, Jbeyq!, with the comma, space and exclamation mark unchanged.- Running the result through again gives
Hello, World!. The "Swap in result" button moves the output back into the input box for exactly this check. ROT13becomesEBG13, because the digits are not letters.
What ROT13 is and is not for
It became a convention on Usenet in the 1980s for hiding spoilers, puzzle answers and punchlines, so a reader has to take a deliberate step to see them. That is its whole purpose: casual obscuring, not secrecy. There is no key, only 25 possible rotations exist, and letter-frequency analysis breaks any of them in seconds, so never use it to protect a password or private message. For real fingerprints, see the hash generator.
Limits
- Accented and non-Latin letters pass through.
cafébecomespnsé, because é is outside A-Z. The result is only partly scrambled and still shows the accent. - Numbers are not rotated. The related ROT5 (digits) and ROT47 (all printable ASCII) variants are not offered here. Only the fixed shift of 13 exists, with no custom-shift option.
- It will not decrypt other ciphers. If a puzzle uses a Caesar shift other than 13, the output will look wrong.
Related text puzzles include the Morse code translator and the leetspeak translator.