How ROT13 & Caesar Cipher works
A Caesar cipher replaces each letter with the one a fixed number of places further along the alphabet, wrapping from Z back to A. Paste your text, set Shift to the key and choose Decode to read a message or Encode to write one. The slider starts at 13, which is ROT13, where encoding and decoding are the same step. If you do not know the key, tick Show all 25 shifts: the tool lists every possible decoding and you pick the row that reads as words. Only the letters A to Z are changed. Capitals stay capitals, and digits, spaces, punctuation and accented letters pass through untouched.
ROT13 alphabet chart
Each letter swaps with the one 13 places away. The table reads in both directions: A becomes N and N becomes A.
| Letter | ROT13 | Letter | ROT13 |
|---|---|---|---|
| A | N | N | A |
| B | O | O | B |
| C | P | P | C |
| D | Q | Q | D |
| E | R | R | E |
| F | S | S | F |
| G | T | T | G |
| H | U | U | H |
| I | V | V | I |
| J | W | W | J |
| K | X | X | K |
| L | Y | Y | L |
| M | Z | Z | M |
Lowercase letters follow the same pairs. Digits are not rotated: "Password123" becomes "Cnffjbeq123".
Caesar shift alphabets for common keys
The plain alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ encoded with each shift, and the forward shift that undoes it.
| Shift | Cipher alphabet | A becomes | Undone by shifting forward |
|---|---|---|---|
| 1 | BCDEFGHIJKLMNOPQRSTUVWXYZA | B | 25 |
| 3 | DEFGHIJKLMNOPQRSTUVWXYZABC | D | 23 |
| 5 | FGHIJKLMNOPQRSTUVWXYZABCDE | F | 21 |
| 7 | HIJKLMNOPQRSTUVWXYZABCDEFG | H | 19 |
| 13 (ROT13) | NOPQRSTUVWXYZABCDEFGHIJKLM | N | 13 |
| 18 | STUVWXYZABCDEFGHIJKLMNOPQR | S | 8 |
| 23 | XYZABCDEFGHIJKLMNOPQRSTUVW | X | 3 |
| 25 | ZABCDEFGHIJKLMNOPQRSTUVWXY | Z | 1 |
Decoding with shift n gives the same result as encoding with shift 26 minus n. Encoding "Attack at dawn" with 3 and decoding it with 23 both give "Dwwdfn dw gdzq".
Worked examples: encode, decode and crack
Encode with Caesar's own shift
Text "Hello, World!", Shift 3, Direction Encode
Khoor, Zruog! Summary: Shift applied +3, Letters changed 10, Reversible with a shift of -3.
Decode when you know the key
Text "Dro combod sc sx dro lyh", Shift 10, Direction Decode
The secret is in the box
Crack the same message with no key
Text "Dro combod sc sx dro lyh", Show all 25 shifts ticked
Row -10 reads "The secret is in the box". Its neighbours, row -9 "Uif tfdsfu jt jo uif cpy" and row -11 "Sgd rdbqds hr hm sgd anw", are plainly not language.
The row label is the key: -10 means the sender shifted forward by 10.
Hide a spoiler with ROT13
Text "The butler did it.", Shift 13
Gur ohgyre qvq vg.
Paste the result back in with the same settings to read it again.
Text with digits and accents
Text "Meet me at 9pm, Café Zoë!", Shift 5, Direction Encode
Rjjy rj fy 9ur, Hfké Etë!
The 9, the comma and the letters é and ë are left exactly as typed. Decoding with shift 5 restores the original.
The Caesar cipher formula
Encode: C = (P + n) mod 26 Decode: P = (C - n) mod 26
Number the letters A = 0 to Z = 25. P is the plain letter, C the cipher letter and n the shift. Mod 26 means that after Z you wrap round to A. Encoding H (7) with n = 3 gives 10, which is K. Encoding Y (24) with n = 3 gives 27, and 27 mod 26 is 1, which is B. With n = 13 the two formulas give the same answer, which is why ROT13 needs no separate decode step.
How to read the Every possible shift table
- It has 25 rows, labelled -1 to -25. Each row is your text shifted backward by that many letters.
- The row that reads as normal language is the plaintext, and its label without the minus sign is the key used to encode.
- The row for 13 is marked (ROT13).
- The table always shows backward shifts of the text in the box. It ignores the Shift slider and the Direction menu, which only affect the main result above it.
- Rows are cut off after 90 characters with an ellipsis, so for a long message use the table to find the key, then set Shift and Decode to get the full text.
- Very short messages can be readable at more than one shift. For example "green" under ROT13 is "terra" and "cheer" shifted by 7 is "jolly". A longer sample settles it.
- If no row is readable, the text is not a Caesar cipher on the 26-letter English alphabet. It may be a keyword cipher such as Vigenere, a scrambled-alphabet substitution, or another encoding entirely.
What ROT13 is used for
ROT13 is not meant to keep anything secret. It hides text from a casual glance while letting anyone who wants to read it do so in one step. That made it the convention on Usenet newsgroups for spoilers, puzzle answers and joke punchlines, and it is still used the same way on forums and in puzzle hunts and geocaching hints.
Because one operation both hides and reveals, there is nothing to get wrong: no key to pass along and no encode or decode choice to make. The same property makes it useless as security. Never use ROT13 or any other Caesar shift on passwords, personal details or anything that would matter if it were read.
How to get your result
- 1
Paste the message into Your text.
- 2
Drag Shift to the key, from 1 to 25. Leave it on 13 for ROT13.
- 3
Set Direction to Decode — shift backward to read a coded message, or Encode — shift forward to make one.
- 4
If the key is unknown, tick Show all 25 shifts and scan the Every possible shift table for the row in plain language.
- 5
Copy the Decoded text or Encoded text. The Summary shows the shift applied and the shift that reverses it.