Caesar Cipher Decoder & Encoder — All 25 Shifts

Paste any Caesar-shifted message and see every possible decoding instantly — all 25 shifts in one table, with the statistically most English-like decode highlighted automatically. Or flip to encode mode and shift your own message with the slider. Everything runs in your browser; nothing is sent to a server.

Ciphertext

What Is a Caesar Cipher?

The Caesar cipher is the oldest and simplest substitution cipher: every letter of the message is shifted forward through the alphabet by a fixed amount, wrapping from Z back to A. With a shift of 3, HELLO becomes KHOOR. The Roman historian Suetonius wrote that Julius Caesar used exactly this scheme — a shift of three — to protect military messages, which is where the cipher gets its name. Because the shift is the only secret, and there are just 25 useful shifts, the Caesar cipher today lives on in puzzles, escape rooms, geocaching hints, and classroom cryptography lessons rather than in real security.

How to Use This Decoder

  1. Paste the ciphertext into the Decode tab. The table of all 25 shifts appears instantly.
  2. Look at the highlighted row — that’s the shift our frequency analysis rates as most English-like. On short texts, scan the neighbors too.
  3. Note the shift number if you need to decode more messages from the same source; the sender almost always reuses one shift.
  4. To encode, switch to the Encode tab, type your message, and drag the slider to pick a shift from 1 to 25.

How the Automatic Crack Works

English text has a famously lopsided letter distribution: E appears about 12.7% of the time, T about 9.1%, while Z sits near 0.07%. A Caesar shift slides that whole distribution sideways without changing its shape. The decoder therefore decodes your text at every one of the 25 shifts and computes a chi-squared statisticfor each: the sum, over all 26 letters, of (observed − expected)² / expected. The decode whose letter counts sit closest to real English scores lowest. Because very short messages (or letter-heavy oddities like pangrams) can fool pure frequency counting, the score also gets a bonus when a decode contains common English words like “the” and “and”. The winner is highlighted; the full table stays visible so you always have the final say.

Worked Example

Take the ciphertext Wkh txlfn eurzq ira. Shifting back by 1 gives Vjg swkem dtqyp hqz — nonsense. Shift 2 is no better. At shift 3 the text becomes The quick brown fox: real words, and letter frequencies that match English closely. The chi-squared test agrees, so shift 3 is highlighted. That is the entire attack — with only 25 keys, brute force plus a frequency test breaks any Caesar cipher in milliseconds.

Frequently Asked Questions

What is a Caesar cipher?

A cipher that shifts every letter forward by a fixed number of positions, wrapping at Z. With shift 3, A→D and Z→C. Named for Julius Caesar, who reportedly used shift 3 for military mail.

How do I decode without knowing the shift?

Try all 25 — that’s what this page does automatically, scoring each candidate against English letter frequencies and highlighting the best one.

What does the highlighted row mean?

It’s the decode whose letter distribution best matches English by chi-squared test, with a bonus for containing common English words. On very short texts, double-check the other rows.

Are punctuation and capitals preserved?

Yes. Only letters shift; spaces, digits, and punctuation pass through untouched, and uppercase stays uppercase.

How is ROT13 related?

ROT13 is a Caesar cipher with shift 13. Since 13 + 13 = 26, encoding twice restores the original — see our dedicated ROT13 decoder.

Is the Caesar cipher secure?

Not at all — 25 keys is trivially brute-forced. Use it for puzzles and teaching, never for anything sensitive.

Does my text leave my browser?

No. Every shift is computed client-side in JavaScript. Nothing is uploaded or logged.

Make Your Own Cipher Puzzles

Decoding is half the fun — if you want to hand someone a printable puzzle, the free cryptogram maker turns any quote into a letter-substitution worksheet with an answer key, ready for classrooms, party games, or KDP activity books.