%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

Caesar & ROT13 Cipher Tool

Results update as you type.

Your numbers

Understanding the Caesar and ROT13 cipher tool — concept and principle

The Caesar cipher replaces every letter with the letter a fixed number of places further along the alphabet. ROT13 is the special case with a shift of 13. People use it to learn the basic ideas of cryptography, to solve puzzles and geocaching clues, and to hide spoilers or punchlines in plain sight. It is a teaching tool, not a way to protect information.

ROT13 pairs each letter with the one 13 places awayWith shift 13, Hello World becomes Uryyb Jbeyq; the space is kept, and applying ROT13 again gives the original.ROT13: every letter slides 13 placesANBOCPDQERFSGTHUIVJWKXLYMZA↔N, B↔O … Z↔M · do it twice = back to startHUerlylyobWJobrelydq␣␣H(7) + 13 = 20 → U · o(14) + 13 = 27 − 26 = 1 → bOnly 25 useful shifts — try them all in seconds
ROT13 swaps the first and second half of the alphabet, so Hello World becomes Uryyb Jbeyq and back again.

How it is calculated

Number the letters A = 0, B = 1, … Z = 25. For a letter x and a shift k:

The tool keeps upper and lower case separate, leaves digits, spaces and punctuation unchanged, and reduces any shift modulo 26, so a shift of 29 behaves like 3 and a negative shift moves letters backwards. The second output applies the shift in the opposite direction to the same text.

The principle

"mod 26" makes the alphabet a circle: after Z you wrap back to A. Shifting forward by k and then back by k returns every letter to where it started, which is why decryption is simply the reverse shift. With k = 13, shifting forward and shifting back are the same move, because 13 + 13 = 26 is one full turn. That is why ROT13 is its own inverse: applying it twice gives back the original text. The cipher is attributed to Julius Caesar, who, according to Suetonius, used a shift of three.

Worked example

  1. Inputs: text "Hello World", shift k = 13.
  2. H (7) → (7 + 13) mod 26 = 20 → U. e (4) → 17 → r. l (11) → 24 → y. o (14) → 27 mod 26 = 1 → b.
  3. W (22) → 35 mod 26 = 9 → J; r (17) → 30 mod 26 = 4 → e; d (3) → 16 → q.
  4. Encrypted: Uryyb Jbeyq. The space is kept.
  5. Shifting back by 13 also gives Uryyb Jbeyq, because for ROT13 the forward and backward shifts are identical. Paste "Uryyb Jbeyq" back in and you get "Hello World".

How to read the result

If the output looks like readable text in a different word order, the shift was wrong; try other values. For an unknown shift, only 25 meaningful keys exist, so trying them all (brute force) breaks any Caesar message in seconds. Frequency analysis is even faster: in English the most common letter of the ciphertext usually corresponds to E.

Common mistakes

Keep in mind: The Caesar cipher and ROT13 can be broken by hand. For real data protection use a modern, well-reviewed algorithm such as AES through a trusted library, never a home-made scheme.

Frequently asked questions

Why is ROT13 used on the internet?

It hides text from a casual glance, for example spoilers or puzzle answers, while anyone who wants to read it can decode it instantly.

How many possible keys does a Caesar cipher have?

26 shifts, of which 25 actually change the text, so an attacker needs at most 25 tries.

Is ROT13 applied twice more secure?

No. Applying ROT13 twice is a total shift of 26, which returns the original text.

Sources: Suetonius, The Lives of the Twelve Caesars, "Divus Julius" 56 · Simon Singh, The Code Book, Fourth Estate, 1999

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →