Cipher Table

ROT13

Rotate every letter thirteen places. Do it again and you are back where you started, so the same tool both hides and reveals.

What ROT13 is for

ROT13 is not meant to keep secrets. It is the written equivalent of printing a quiz answer upside down at the bottom of the page: you have to make a small deliberate effort to read it.

It became a convention on Usenet discussion groups in the early 1980s, where people used it to hide joke punchlines, puzzle solutions, plot spoilers and remarks that some readers might prefer not to see. Most newsreader software had a single keystroke to unscramble it.

How it works

Each letter is replaced by the one thirteen places along, wrapping round at Z:

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

Letters in the top row swap with the letter directly beneath, and the other way round. HELLO becomes URYYB, and URYYB becomes HELLO.

It is a Caesar cipher with the key fixed at 13, and so it inherits all of that cipher’s weaknesses plus one more: everyone already knows the key.

A few curiosities

Some English words turn into other English words under ROT13. IRK and VEX are a pair, pleasingly, since they mean much the same thing. So are BALK and ONYX, TERRA and GREEN, and FURBY and SHEOL.

If you want the same no-key convenience but covering digits and symbols, look at Base64. If you want an actual secret, you will need a cipher with a key: start with Vigenère.

Questions people ask

Why thirteen?

The alphabet has 26 letters and 13 is exactly half. Shifting by 13 twice makes a full circle of 26, so encoding and decoding are the same operation. No other shift has that property.

Does ROT13 change numbers or punctuation?

No. Only the letters A to Z move. Digits, spaces and punctuation stay as they are. A variant called ROT47 rotates most keyboard symbols as well.

Is ROT13 encryption?

Not in any useful sense. There is no key, so anyone who recognises it can read it. Its purpose is to stop you reading something by accident, like a spoiler or a punchline.