Caesar Cipher
A Caesar cipher shifts every letter of a message a fixed number of places along the alphabet, so with a shift of 3, A becomes D and "Attack at dawn" becomes "Dwwdfn dw gdzq".
Input
Encoded with shift 3
Why use our Caesar Cipher?
Encode and Decode in One Box
Switch between Encode and Decode with one press. The output updates as you type, and the line under the shift shows what A becomes.
Crack an Unknown Shift
Paste a message with no key and all 25 shifts are decoded, scored and listed, with the most English-looking one marked.
Stays in Your Browser
The shifting and the scoring run on this page. Your message is not sent to a server or stored.
What is a Caesar Cipher?
A Caesar cipher is a shift cipher: every letter of a message moves the same number of places along the alphabet, and that number is the key. Only the 26 letters move, so a shifted message keeps its spaces, punctuation and word lengths.
The name comes from Julius Caesar. Suetonius writes that to read Caesar's letters one "must substitute the fourth letter of the alphabet, namely D, for A, and so with the others." That is a shift of 3, the default on this page. Source: Suetonius, Life of Julius Caesar 56.6.
How the Shift Cipher Works
- Wrap around:Letters wrap around the end: at shift 3, X becomes A and Z becomes C.
- Case:Capitals stay capitals and lowercase stays lowercase.
- Left as typed:Digits, punctuation, spaces, accented letters such as é and emoji are left as typed.
- Decoding:Decoding k is the same as encoding 26 minus k, so every key has exactly one way back.
Common Use Cases
Classroom Cryptography
Show how a shift cipher works, then let students break each other's messages with the ranked list of shifts.
Puzzle and Escape Room Clues
Write a clue that players can work out by hand, and decode it once more to check it before you print it.
Solving a Found Message
Paste a shifted line from a puzzle book or a game and let the Unknown shift panel suggest the key.
Hiding a Punchline
Set the shift to 13 to hide a spoiler or a punchline. The reader applies shift 13 again to see it.
Learning Frequency Analysis
Compare the scores across the 25 rows to see why common letters such as E give a message away.
Fitting a Length Limit
Shifting never changes how long a message is, so check it once with the character counter before or after you encode.
How to Use the Caesar Cipher Encoder
Type your message
Type or paste the message you want to encode or decode into Text.
Choose Encode or Decode
Press Encode to hide a message, or Decode to read one that was already shifted.
Set the shift
Use the box or the - and + buttons to set the Caesar shift from 1 to 25. The default is 3.
Copy or solve
Copy the output. If you do not know the key, open Unknown shift, read the 25 rows and press Use shift on the one that makes sense.
Caesar Cipher Decoder: Decode with a Key or an Unknown Shift
Decode with a Key
To decode with key k, press Decode and set the shift to k. Example with a key: "Dwwdfn dw gdzq" decoded with shift 3 gives "Attack at dawn".
Every Shift Listed
With an unknown shift, open the Unknown shift panel. It lists all 25 shifts with a score and a Use shift button.
One Press to Apply
Use shift copies that row's key into the decoder above, so you can edit the message and keep decoding with it.
Stable Order
Rows stay in shift order, 1 to 25. The best guess is marked Most English-looking instead of being moved to the top.
Read the Others
If the marked row is gibberish, read the others: short or non-English text can push the right shift down the ranking.
Long Messages
Each row previews the first 60 characters, and the panel summary shows the best guess before you open it.
How the Ranking Works
- •Frequency analysis: Count each letter, compare with how often it appears in English, and add up the gaps as a chi-squared score.
- •Lower wins: Lower score looks more English. The frequencies come from the Lewand table, where E is the most common letter.
- •Short text: Short text fools it. "Hello world" shifted by 3 ranks the right shift third, behind shift 6, "Ebiil tloia". Below 20 letters the panel warns you.
- •Scores shown: Each row shows its score to one decimal place, so you can see how close the runner-up is.
- •No letters: If the text has no letters A to Z, nothing is shifted and no guess is made.
- •Sources: Practical Cryptography on the chi-squared statistic, Letter frequency on Wikipedia.
Encode or Crack a Caesar Shift
Pick a shift from 1 to 25 to encode a note for a friend, or paste a coded line and let the 25 ranked shifts point you at the key.
There is no account and nothing to install. Close the tab and the message is gone, because the page never saves it.
ROT13, Vigenere and Why Caesar Is Easy to Break
- ROT13 is shift 13, used to hide spoilers on Usenet, and running it twice gives the original. See the ROT13 encoder.
- With only 25 shifts, a brute force attack tries them all. The earliest surviving record of frequency analysis is by Al-Kindi in the 9th century.
- Vigenere uses a different Caesar shift at each position, set by a repeating keyword.
Source: Caesar cipher on Wikipedia.
Related tools
Frequently Asked Questions
How do I decode a Caesar cipher without the key?
Paste the message and open Unknown shift. All 25 shifts are decoded and scored against English letter frequencies, and the lowest score is marked Most English-looking. Read the list, because short messages can fool the score.
What shift did Julius Caesar use?
Suetonius says that to read Caesar's letters you substitute the fourth letter of the alphabet, D, for A, which is a shift of 3.
Is ROT13 a Caesar cipher?
Yes. ROT13 is a Caesar shift of 13, so applying it twice returns the original: Uryyb back to Hello.
How many possible Caesar shifts are there?
There are 25 useful shifts in English. A shift of 26 gives back the original text, which is why trying every shift is quick.
Does the Caesar cipher change numbers and punctuation?
No. Only A to Z and a to z move, and they keep their case. Shift 3 turns "Zebra 42!" into "Cheud 42!".
Why is the Caesar cipher not secure?
There are only 25 shifts to try, and letter frequencies give the answer away, so anyone can break it in seconds.