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.
Here it is with your numbers:
- V is letter 22. 22 + 3 is 25, which is Y.
- e is letter 5. 5 + 3 is 8, which is h.
- n is letter 14. 14 + 3 is 17, which is q.
- 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.
| Shift | Decoded |
|---|---|
| 1 | Xgpk, xkfk, xkek |
| 2 | Wfoj, wjej, wjdj |
| 3 | Veni, vidi, vici |
| 4 | Udmh, uhch, uhbh |
| 5 | Tclg, tgbg, tgag |
| 6 | Sbkf, sfaf, sfzf |
| 7 | Raje, reze, reye |
| 8 | Qzid, qdyd, qdxd |
| 9 | Pyhc, pcxc, pcwc |
| 10 | Oxgb, obwb, obvb |
| 11 | Nwfa, nava, naua |
| 12 | Mvez, mzuz, mztz |
| 13 | Ludy, lyty, lysy |
| 14 | Ktcx, kxsx, kxrx |
| 15 | Jsbw, jwrw, jwqw |
| 16 | Irav, ivqv, ivpv |
| 17 | Hqzu, hupu, huou |
| 18 | Gpyt, gtot, gtnt |
| 19 | Foxs, fsns, fsms |
| 20 | Enwr, ermr, erlr |
| 21 | Dmvq, dqlq, dqkq |
| 22 | Clup, cpkp, cpjp |
| 23 | Bkto, bojo, boio |
| 24 | Ajsn, anin, anhn |
| 25 | Zirm, 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”.