I The shift
How the letter shift works
A Caesar cipher moves every letter the same number of places along the alphabet. That number is the shift.
With a shift of 3, A becomes D, B becomes E and M becomes P. Near the end of the alphabet the letters wrap round to the start: X becomes A, Y becomes B and Z becomes C.
To read a coded message, move each letter back by the same number of places.
II Examples
See it in a message
Each example uses a shift of 3. Spaces and punctuation stay where they are.
- HELLO becomes→ KHOOR
- MEET AT NOON becomes→ PHHW DW QRRQ
III Steps
Encode or decode a message
- Choose Encrypt to turn your message into a code, or Decrypt to read one.
- Pick a letter shift from 1 to 25 and type or paste your message. To decode, use the shift that was used to encode.
- Read the result, and use Copy result to take it with you.
IV Unknown shift
What if you don’t know the shift?
There are just 25 shifts that change any letters. A shift of 26 moves every letter all the way round to where it began.
That means a coded message has to be one of 25 possibilities. Choose Try every shift, look down the list and find the line that reads as ordinary words.
V The name
Why is it called a Caesar cipher?
The cipher takes its name from Julius Caesar. The Roman writer Suetonius, in his Lives of the Caesars, describes Caesar swapping every letter of a message for the one three steps further along the alphabet, so that A turned into D.
Sources: Britannica, “Caesar cipher” (opens in a new tab); and Simon Singh, The Black Chamber, “Caesar Cipher” (opens in a new tab). Checked 18 November 2026.
VI Privacy
Can it keep a message private?
No. A Caesar cipher is easy to reverse, because there are just 25 shifts to try, and a letter that repeats in the message repeats in the code too, so patterns show through.
Use it for puzzles and learning. For passwords and private messages, use modern tools.
A code that’s easy to guess isn’t a secret. Use a different password for every account.
To crack a Caesar code without knowing the shift, count its letters. To see what a keyword adds, try the Vigenère cipher, which changes the shift for every letter.
VII Maths
The maths behind the shift
Number the letters from A = 0 to Z = 25. The 26 letters A to Z are the ones that change: capitals stay capitals, and spaces, punctuation, numbers and accented letters are left as they are.
- To encode: (letter + shift) mod 26
- To decode: (letter − shift) mod 26
“Mod 26” means the remainder after dividing by 26, which brings any number back into the range 0 to 25. When you decode, the answer can fall below 0: if it does, add 26. For example, B is 1, and taking away a shift of 3 gives −2, which becomes 24 once 26 is added, and 24 is Y.
Example: Y is 24. Add a shift of 5 and you get 29, which wraps to 3, and 3 is D.
VIII Questions
Common questions
Does the shift have to be 3?
No. Any shift from 1 to 25 works. This tool lets you choose.
What happens with a shift of 26?
Every letter lands back where it started, so the message doesn’t change. It is the same as no shift at all.
What is ROT13?
ROT13 is a Caesar cipher with a shift of 13. The alphabet has 26 letters, so doing it twice brings you back to the original text.
How do I write “I love you” with a shift of 3?
L ORYH BRX.
Why does my decoded text look wrong?
Check the mode and the shift. Use Decrypt to read a coded message, and use the same shift that was used to encode it. If you don’t know the shift, try every shift.
Is my text sent anywhere?
No. It’s processed in your browser and never sent to our servers or stored.