ROT13 / Caesar Cipher

Encode or decode text with the Caesar cipher using any shift from 1 to 25, or use ROT13 (shift 13) — preserves case and leaves non-letters untouched.

113 (ROT13)25

Letters only are shifted; numbers, spaces, and punctuation are preserved.

Enter text above to see the result

Formula

Encoded = (position + 13) mod 26

ROT13 / Caesar Cipher

The Caesar cipher is one of the oldest and simplest encryption techniques, attributed to Julius Caesar, who used it to protect military messages. It works by shifting every letter in the plaintext a fixed number of positions along the alphabet, preserving case and leaving non-letter characters untouched. ROT13 is the most common variant, using a shift of 13, which makes encoding and decoding identical operations since the alphabet has 26 letters.

Despite its simplicity, understanding the Caesar cipher is fundamental to learning about cryptography and substitution ciphers. ROT13 is widely used on the internet to obscure spoilers, puzzle answers, or offensive content without truly encrypting it. This tool lets you choose any shift value from 1 to 25 and toggle between encoding (forward shift) and decoding (reverse shift), making it easy to experiment with the full family of Caesar ciphers.

How it works

Encoded letter = ((original position + shift) mod 26). Positions are 0-indexed (A=0 … Z=25). For decode, use shift = 26 − shift_used. ROT13 is self-inverse: applying it twice returns the original text.

Use cases

  • Hiding spoilers or puzzle answers on forums and social media
  • Teaching basic cryptography and substitution cipher concepts
  • Obscuring text in emails or documents without strong encryption
  • Decoding ROT13-encoded text found online or in legacy systems
  • Creating simple word games or escape-room puzzles

Frequently asked questions

What is ROT13 and how does it work?

ROT13 is a Caesar cipher with a fixed shift of 13, so each letter is replaced by the one 13 positions later in the alphabet. Because the alphabet has 26 letters, applying ROT13 twice returns the original text, which makes encoding and decoding the exact same operation.

How do I decode a Caesar cipher?

To decode, apply the reverse shift: if the text was encoded with a shift of N, decode with a shift of 26 − N. For example, text shifted by 3 is decoded by shifting 23 (or shifting −3). This tool has a decode mode that reverses the shift automatically.

Is the Caesar cipher secure for real encryption?

No. With only 25 possible shifts, a Caesar cipher can be broken in seconds by trying every shift or by frequency analysis. It is useful for hiding spoilers, teaching cryptography basics, or puzzles, but never for protecting sensitive data, which needs modern algorithms like AES.

What is the formula for the Caesar cipher?

Each letter is transformed with encoded position = (original position + shift) mod 26, where letters are numbered A=0 through Z=25. Non-letter characters like spaces and digits are left unchanged, and the case of each letter is preserved.

Why is ROT13 so common on the internet?

ROT13 became popular because it reversibly obscures text with a single simple operation, letting forums and newsgroups hide spoilers, punchlines, or offensive content behind a click. Readers can reveal the text just by applying ROT13 again, with no key to remember.

Related Calculators