First, check that it is a Caesar cipher
A Caesar cipher moves every letter by the same amount and leaves the rest alone. That leaves a few signs. Spaces and punctuation are usually still there, so the text looks like sentences made of nonsense words. Doubled letters stay doubled. Some letters appear much more often than others, in the same uneven pattern as a normal language.
To see that pattern, paste the text into the frequency analysis tool. If the counts are close to even, you are probably looking at a different cipher.
The quickest method: try every shift
With the 26-letter alphabet there are only 25 shifts, so you can simply try them all. The solver does this for you, and it handles Polish, German and Spanish letters too. To see how the method works and to run it without leaving the page, use the brute force attack page.
By hand: count the letters
Trying 25 shifts by hand is slow, and counting gets you there in fewer tries. In a normal text, one or two letters appear far more often than the rest. In English, that letter is E. Al-Kindi described this idea, frequency analysis, in the 9th century. Take this message:
DL DPSS TLLA HA AOL VSK IYPKNL DOLU AOL LCLUPUN ILSS YPUNZ. IYPUN AOL SLAALY HUK ALSS UVIVKF DOLYL FVB HYL NVPUN. The most common letter is L, which appears 17 times in 90 letters. Here are the top three:
| Letter | Times |
|---|---|
| L | 17 |
| S | 8 |
| A | 8 |
Now assume L stands for the language’s most common letter, and work out the shift. Number the alphabet from A = 0. Then L = 11 and E = 4, so the shift is 11 − 4 = 7. Move every letter back by 7 and read:
| If L stands for | Shift | Start of the result |
|---|---|---|
| E | 7 | WE WILL MEET AT THE OLD BR… |
The first try works here, but it will not always. Short texts often have a different top letter, so if the result is nonsense, try the next common letter of the language: T, then A.
Show the whole message
WE WILL MEET AT THE OLD BRIDGE WHEN THE EVENING BELL RINGS. BRING THE LETTER AND TELL NOBODY WHERE YOU ARE GOING.
By hand: guess a word
You can also start from a word. Short, common words are easy to spot, and one correct guess gives you the shift for the whole message. In the message above, the word AOL appears three times. If it is THE, then A stands for T. A = 0 and T = 19, and 0 − 19 + 26 = 7, the same shift we found by counting. Add 26 whenever the result is negative.
This also works for substitution ciphers, where it takes longer. See pattern recognition for more clues to look for.
How a computer picks the answer
A program cannot read, so it measures. For each shift, it compares the letter counts with what the language should have. A common way to do this is the chi-squared statistic, where the lowest value marks the best match:
χ² = Σ (observed − expected)² / expected Our solver uses a similar idea: it gives each line a score based on letter frequencies and puts the highest score first. A score can still mislead on very short text, so read the top line before you trust it.
If nothing works
If no shift gives readable words, the text probably uses something else. A shift of 13 is ROT13, which the solver covers. A reversed alphabet is Atbash. Even letter counts suggest Vigenère, and a normal uneven pattern with no working shift suggests a substitution cipher.
Modern encryption is different. None of these methods will open an encrypted file, a password or a message protected with AES, which was designed to hide all these patterns. From the Caesar cipher to modern encryption explains why.
Frequently asked questions
Can you decrypt a Caesar cipher without the key?
Yes. There are only 25 shifts with the 26-letter alphabet, so you can try them all or work out the shift from letter counts or a guessed word.
Which letter should I look for first?
Find the most common letter in the coded text and assume it stands for the most common letter of the language. In English, that is E.
How do I work out the shift from one letter?
Number the alphabet from A = 0 and subtract the plain letter from the cipher letter. If the result is negative, add 26.
What if no shift gives readable text?
The text probably uses another cipher, such as Vigenère or a substitution cipher, or it is not a cipher at all.