Home › Ciphers › Caesar Cipher Solver
Caesar Cipher Solver
A Caesar cipher has only 25 possible keys, so the honest way to solve one is to try them all. This solver does exactly that — every shift, decoded and scored — and ranks the results so the reading that is actually English floats to the top. Your spaces, numbers and punctuation are left exactly where they were; only the letters move.
A Caesar cipher solver breaks a shift cipher whose key you do not know. It decodes the message 25 times — once per possible shift — scores each attempt against English letter frequencies (chi-squared) and real-word evidence, and ranks them best first. Shift 13, the famous special case, is ROT13.
Also called a Caesar brute-forcer or shift-cipher cracker. If no shift produces English, the text is not Caesar — the page tells you what to try instead.
Brute-force your message
The unknown-shift problem, and why it is easy
A Caesar cipher shifts every letter the same distance through the alphabet: with shift 3, A becomes D, B becomes E, and Z wraps around to C. In the formula every textbook prints, encryption is E(x) = (x + s) mod 26 and decryption is D(x) = (x − s) mod 26, where s is the shift. If you know s, decoding is trivial. The solver exists for when you do not — and its whole secret is that s has only 25 possible values worth trying (shift 0 changes nothing, and shift 26 is shift 0 again). Trying all of them is not a weakness of the method; it is the method, and it has a name as old as cryptanalysis: brute force over a tiny key space.
How the ranking works
Twenty-five decodings are useless without a judge. Each attempt is scored two ways. Chi-squared frequency fit: the attempt's letter counts are compared with published English frequencies — the correct shift produces about 12.7% E and very little Z, and chi-squared (Karl Pearson's test, 1900) turns “how close?” into a number. Word evidence: the share of the attempt's words that are real, common English words. On a long text the frequency fit alone is decisive — in testing, a correct shift scored 72 against the best wrong shift's 13. On a short text the word evidence does the heavy lifting, which is why the one-word example below still ranks correctly. The results list shows all 25 scores, so you can see the winner win.
What does not move
Only the 26 letters are shifted. Spaces stay spaces, so word lengths survive; numbers, punctuation and capitalisation pass through untouched, and a capital letter decodes to a capital letter. That fidelity matters: a message like PHHW PH DW WKH SDUN DW 9 SP keeps its 9 exactly where the sender put it, and the shape of the text — itself a clue — is never destroyed by the tool that reads it.
Suetonius, Augustus, and the first frequency analyst
The cipher is named for Julius Caesar because the Roman historian Suetonius, writing around AD 121, describes him using it: Caesar shifted each letter three places (A to D) so that, in Suetonius's phrase, the meaning would be hidden from a casual reader. His successor Augustus used a shift of one — and, Suetonius adds, did not even wrap around properly: for the last letter he wrote a doubled A. Neither man was hiding from cryptanalysts; they were hiding from the merely curious, and against that threat the cipher served for centuries.
The attack is nearly as old as the cipher's fame. The earliest surviving description of frequency analysis — the observation that letters occur at predictably different rates, and that counting them betrays a substitution — was written in the ninth century by the Arab philosopher and mathematician al-Kindi, in his treatise on deciphering cryptographic messages. Against a Caesar cipher you do not even need al-Kindi's full method: with only 25 keys, counting gives way to simply trying them all. The chi-squared scoring this page adds is al-Kindi's insight wearing twentieth-century statistics.
- c. 100 BC — Caesar uses a shift of three (reported by Suetonius, c. AD 121).
- c. AD 1 — Augustus uses a shift of one, without proper wrap-around.
- 9th century — al-Kindi describes frequency analysis, the attack that still works.
- 1900 — Pearson's chi-squared test gives the attack a rigorous score.
The alphabet, shifted
When you run the solver, the strip above the results shows the winning shift as two alphabet rows — read any cipher letter off the top row and its plaintext partner sits directly beneath. For reference, the classical shift of three, the one Suetonius reports, looks like this:
| Plain | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
|---|---|
| Cipher (shift 3) | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C |
Note the wrap-around at the end — X, Y, Z become A, B, C — the detail Augustus reportedly skipped. Every other shift is the same picture slid along; there are only 25 distinct pictures, which is the whole story of this cipher's insecurity.
Long text, short text, and the famous 13
Example 1 — a full message (load it above)
At over 200 letters, the frequency evidence is overwhelming: shift 7's decoding fits English so much better than the other 24 that the ranking is not close. The text opens “THE HISTORY OF SECRET WRITING IS LONG AND FULL OF SURPRISES…” — and the solver's margin, not just its answer, is what tells you to trust it.
Example 2 — just one word (load it above)
Five letters carry almost no frequency evidence — one rival shift produces WTAAD, whose letter counts are, by luck, not much worse. What settles it is the second signal: shift 3's HELLO is a real word and WTAAD is not, so the word evidence promotes the true reading to the top (in the tool's scoring, 44 against 5). The honest limit sits one step further down: a single cipher letter, say B, has two genuinely plausible readings — A (shift 1) and I (shift 19) are both English words — and no solver can choose between them without more text.
Example 3 — ROT13 (load it above)
Shift 13 decodes to the pangram “THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG”. Note the pangram's oddity: because it uses every letter, its frequencies are flatter than ordinary English, so its frequency score is modest — the word evidence (every word real) carries it to first place anyway. Two scoring signals are better than one, and this example is why.
Why Caesar falls, and when this solver is the wrong tool
The Caesar cipher's key space — 25 — is smaller than the number of minutes in an hour's idle guessing. It offers no security against anyone, and never really did: it defeated the unmotivated, not the analyst. ROT13 inherits the weakness completely and adds a quirk: because 13 is half of 26, encryption and decryption are the same operation, which is why the internet adopted it for hiding spoilers and punchlines — a veil, not a lock, deliberately easy to lift.
- “No shift produced English.” Then it is not a Caesar cipher. If the frequencies are English-shaped, it is a scrambled substitution — take it to the cryptogram solver. If they are flat, suspect Vigenère. The Identifier separates the three in one paste.
- “The top two shifts are close.” Your text is short. Read both decodings in full — a human spots the real sentence faster than any scorer — and distrust any ranking built on under 25 letters.
- “It decoded, but only the first half reads.” The shift probably changed mid-message (a progressive-key scheme), or two messages were pasted as one. Solve the halves separately.
ROT13, ROT-N, Atbash — and the road to Vigenère
| Relative | How it differs | Solve it with |
|---|---|---|
| ROT13 | Caesar fixed at shift 13; applying it twice restores the text | This solver (it will win the ranking), or any ROT13 tool |
| ROT-N / shift ciphers generally | “ROT” plus a number is just Caesar by another name — ROT5 twists digits, ROT18 mixes both | This solver for letters; the same idea digit-by-digit for numbers |
| Atbash | Not a shift but a mirror: A↔Z, B↔Y. No shift will ever decode it | The Atbash page — or spot GSV standing for THE |
| Vigenère | A Caesar whose shift changes letter by letter under a keyword — thousands of alphabets, not 25 | The Vigenère solver, which finds the key length first |
The Caesar cipher page carries the full guide — encoding with a chosen shift, the printable wheel, and the classroom material. This page is its attacking twin: same cipher, opposite direction.
Where shifted text still lives
ROT13's afterlife is the famous one: on Usenet, from the 1980s onward, it became the standard way to post a spoiler, a punchline or a puzzle answer — visible to anyone who chose to look, invisible to anyone scrolling past, which is precisely the social contract the cipher is good for. Its descendants are everywhere: spoiler tags, “rot13” commands in chat clients, puzzle hunts that use a shift as the warm-up step before the real cipher, and the plastic decoder rings that taught generations of children what a key is. In CTF competitions a Caesar message is the traditional first flag — not because it is hard, but because recognising it instantly is the entry ticket. The solver on this page is, in that sense, a museum piece that still works for a living.
Two shifts to crack by eye
Before you run them: guess the shift from the shortest common word, then check yourself against the solver's ranking.
Practice 1
Reveal the answer
Shift 3. The giveaway is DW, a two-letter word that must be AT, AS or TO — and WKH right after it is THE with the same shift. “MEET ME AT THE PARK AT MIDNIGHT AND BRING THE KEY.”
Practice 2
Reveal the answer
Shift 19 (equivalently, decode by shifting back 19 — or forward 7). MAX appears twice where THE belongs. “THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG” — the pangram again, wearing a different shift; compare its score with Example 3's and see the same text judged by the same evidence.
The printable Caesar wheel in the sidebar is the by-hand version of this page: two alphabet discs, one pin, all 25 shifts in your pocket.
Frequently asked questions
How is the “shift” number defined here?
As the encryption shift: the number of places each plaintext letter was moved forward. If a message was encrypted with shift 3 (A→D), the winning row is labelled shift 3 and its decoding moves every letter back by three. Some tools label by the decoding movement instead, which flips the sign — if another tool disagrees with this one by direction, check which convention it uses before doubting either.
Can the solver handle ROT13 specifically?
Yes — ROT13 is simply the shift-13 row, and the ranking will normally put it first for ROT13 text. Because ROT13 is its own inverse, you can also paste already-decoded text and the same row will re-encode it.
Why does it keep my punctuation and numbers unchanged?
Because the cipher does. Caesar shifting is defined on letters only; a faithful solver mirrors the cipher exactly, preserving word lengths, spacing and every non-letter — all of which are evidence you may need for the next step.
The winner is wrong but second place is right. What happened?
Almost always: a short text. Under a sentence or so, frequency evidence is thin and an unlucky letter distribution can crown the wrong shift. The full 25-row ranking is shown precisely so a human can overrule the scorer — on short input, your eye is the better instrument and the list is just well-organised options.
What if my text uses a keyed alphabet and a shift?
Then it is not a plain Caesar cipher, and no single shift will open it — that construction is a keyed substitution, and its home is the cryptogram solver, whose search handles arbitrary alphabets.
Does my text leave my device?
No. All 25 decodings and their scoring run in your browser.