Caesar Cipher

  • Tested against Python's own ROT13 and 400 shifted texts worked out separately
  • Checked by Wayne Bickerton
  • Sources: Suetonius
  • Updated November 11, 2026

A Caesar cipher moves every letter the same number of places along the alphabet: with a shift of 3, A becomes D, and Z wraps round to C. Type a message and pick a shift to encode it, or switch to Decode to undo it. Don’t know the shift? The table under the calculator shows all 25, so you can spot the one that reads as English.

places

Only the letters A–Z move. What you type goes into the page’s link, so Share link can send it.

Encoded
Yhql, ylgl, ylfl Shift 3

Moving every letter 3 places along the alphabet turns “Veni, vidi, vici” into “Yhql, ylgl, ylfl”.

Shift 3 (A → D)
Letters moved 12
To undo it Shift back 3
Plain
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher
DEFGHIJKLMNOPQRSTUVWXYZABC

How to encode a Caesar cipher

Number the letters A = 1 to Z = 26. Add the shift to each letter’s number; if you go past 26, start again from A. Capitals stay capitals, and spaces, digits and punctuation don’t change. To decode, subtract the shift instead.

New letter = (letter number + shift), counting round from Z back to A

Here it is with your numbers:

  1. V is letter 22. 22 + 3 is 25, which is Y.
  2. e is letter 5. 5 + 3 is 8, which is h.
  3. n is letter 14. 14 + 3 is 17, which is q.
  4. Do the same for every letter; anything else stays as it is: “Yhql, ylgl, ylfl”.

It means “Veni, vidi, vici” encodes to “Yhql, ylgl, ylfl” with a shift of 3.

The Plain and Cipher rows under the result are the whole key: find a letter in the top row and read its partner underneath.

Try every shift

Each row decodes the start of your output with a different shift. With a real message, only one row reads as English: that is the key.

ShiftDecoded
1Xgpk, xkfk, xkek
2Wfoj, wjej, wjdj
3Veni, vidi, vici
4Udmh, uhch, uhbh
5Tclg, tgbg, tgag
6Sbkf, sfaf, sfzf
7Raje, reze, reye
8Qzid, qdyd, qdxd
9Pyhc, pcxc, pcwc
10Oxgb, obwb, obvb
11Nwfa, nava, naua
12Mvez, mzuz, mztz
13Ludy, lyty, lysy
14Ktcx, kxsx, kxrx
15Jsbw, jwrw, jwqw
16Irav, ivqv, ivpv
17Hqzu, hupu, huou
18Gpyt, gtot, gtnt
19Foxs, fsns, fsms
20Enwr, ermr, erlr
21Dmvq, dqlq, dqkq
22Clup, cpkp, cpjp
23Bkto, bojo, boio
24Ajsn, anin, anhn
25Zirm, zmhm, zmgm

Caesar cipher history

The Roman historian Suetonius wrote that Julius Caesar, when he had something confidential to write, changed the order of the letters so that no word could be read, and that to read them you substitute the fourth letter, D, for A. That is a shift of 3: “Dwwdfn dw gdzq” for “Attack at dawn”.

Source Suetonius · Life of Julius Caesar, §56 (LacusCurtius, University of Chicago) ↗

FAQs

What is Caesar’s cipher?

A code where every letter is replaced by the letter a fixed number of places further along the alphabet. Julius Caesar used a shift of 3, writing D for A, E for B and so on, according to the Roman historian Suetonius.

Source Suetonius · Life of Julius Caesar, §56 (LacusCurtius, University of Chicago) ↗

How do you decode a Caesar cipher?

Shift every letter back by the same number. If the shift is 3, D goes back to A. If you don’t know the shift, try all 25 (the table above does it for you) and pick the one that makes sense.

Is the Caesar cipher always 3?

No. Caesar himself used 3, but any shift from 1 to 25 works the same way. A shift of 13 is called ROT13: doing it twice gives back the original, because 13 + 13 is 26.

Is the Caesar cipher hard to decode?

No: there are only 25 shifts to try, so a person can crack it by hand in minutes and a computer instantly. It is a puzzle or a teaching tool, not a way to keep secrets.

How do you say “I love you” in Caesar cipher?

With Caesar’s shift of 3, “I love you” becomes “L oryh brx”. With ROT13 it is “V ybir lbh”.

Sources

Related calculators