Skip to content

Caesar Cipher Decoder and ROT13 Converter

Shift letters forward or back by 1 to 25 places, or list every possible shift at once to read a message when you do not know the key.

Runs in your browserFree, no sign-upLast reviewed

Settings

13 is ROT13, where encoding and decoding are the same operation.

Results update automatically as you type.

Encoded text

Gur dhvpx oebja sbk whzcf bire gur ynml qbt

Summary

Shift applied
+13
Letters changed
35
Reversible with
The same ROT13 operation

Quick answers

How do I decode a Caesar cipher without knowing the shift?
Try every key. There are only 25, so tick Show all 25 shifts and read down the table until one row is readable. For "Wkh txlfn eurzq ira" the row labelled -3 reads "The quick brown fox", which means the message was encoded with a shift of 3.
How do I decode ROT13?
Apply ROT13 again. Shifting by 13 twice moves each letter 26 places, a full trip round the alphabet. Paste the text with Shift on 13 and either Direction: "Uryyb, Jbeyq!" comes back as "Hello, World!".
What is the difference between ROT13 and a Caesar cipher?
ROT13 is one particular Caesar cipher: the one with a shift of 13. A Caesar cipher can use any shift from 1 to 25. ROT13 is the only one of them that undoes itself, because 13 is half of 26.
How many possible keys does a Caesar cipher have?
25. The alphabet has 26 letters, and a shift of 26 (or 0) leaves the text unchanged, so shifts 1 to 25 are the only ones that produce a cipher. That is few enough to try all of them by hand.
What shift did Julius Caesar use?
Three, according to the Roman historian Suetonius: A was written as D, B as E, and so on. With a shift of 3, "VENI VIDI VICI" becomes "YHQL YLGL YLFL".
Is a Caesar cipher secure?
No. With 25 possible keys, anyone can read the message by trying each one, which is what the all-shifts table on this page does. Treat it as a puzzle or a way to hide spoilers, never as protection for private information.

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.

LetterROT13LetterROT13
ANNA
BOOB
CPPC
DQQD
ERRE
FSSF
GTTG
HUUH
IVVI
JWWJ
KXXK
LYYL
MZZM

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.

ShiftCipher alphabetA becomesUndone by shifting forward
1BCDEFGHIJKLMNOPQRSTUVWXYZAB25
3DEFGHIJKLMNOPQRSTUVWXYZABCD23
5FGHIJKLMNOPQRSTUVWXYZABCDEF21
7HIJKLMNOPQRSTUVWXYZABCDEFGH19
13 (ROT13)NOPQRSTUVWXYZABCDEFGHIJKLMN13
18STUVWXYZABCDEFGHIJKLMNOPQRS8
23XYZABCDEFGHIJKLMNOPQRSTUVWX3
25ZABCDEFGHIJKLMNOPQRSTUVWXYZ1

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. 1

    Paste the message into Your text.

  2. 2

    Drag Shift to the key, from 1 to 25. Leave it on 13 for ROT13.

  3. 3

    Set Direction to Decode — shift backward to read a coded message, or Encode — shift forward to make one.

  4. 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. 5

    Copy the Decoded text or Encoded text. The Summary shows the shift applied and the shift that reverses it.

Common questions

Does it decode ROT5, ROT18 or ROT47?
No. Those variants also rotate digits or the wider set of keyboard symbols. This tool shifts only the 26 letters, so digits and symbols always come through unchanged. Setting Shift to 5 or 18 gives a letter-only Caesar shift of that size.
Why do Encode and Decode give the same result at shift 13?
Moving 13 places forward and 13 places backward land on the same letter, because the two moves differ by 26, a full lap of the alphabet. At any other shift the two directions give different results.
What does Letters changed mean in the Summary?
It is the number of A to Z letters in your text, which is how many characters the shift touched. Spaces, digits, punctuation and accented letters are not counted. "Hello, World!" shows 10.
Can I use a shift bigger than 25 or a negative shift?
The slider runs from 1 to 25, which covers every distinct result. A shift of 26 changes nothing, 27 is the same as 1, and a backward shift of n is the same as a forward shift of 26 minus n.
Can it break a Vigenere or keyword cipher?
No. Those ciphers change the shift from letter to letter, so no single row of the all-shifts table will be readable. This page handles one fixed shift across the whole message.
Does it work with other alphabets, such as Cyrillic or Greek?
No. Only unaccented Latin letters are shifted. Letters from other alphabets, and Latin letters with accents such as é or ñ, are passed through as they are.
How can I spot the key without reading all 25 rows?
Look at short words. A one-letter word is almost always A or I, and a common three-letter word is often THE. In "Wkh txlfn eurzq ira", guessing that Wkh is The means W stands for T, a shift of 3.
Is the message I paste sent to a server?
No. The shifting is done in your browser and nothing is uploaded or saved.

Looking for something else? Browse all text tools or see every tool.