The Caesar Cipher Explained (With Examples)
How the classic shift cipher works, how to encode and decode it, and why it’s only for puzzles now.
How the Caesar cipher works
The Caesar cipher shifts every letter a fixed number of places along the alphabet, wrapping from Z back to A. With a shift of 3 — the version Julius Caesar reputedly used — A becomes D, B becomes E, and so on. Spaces, numbers and punctuation are usually left unchanged.
Encoding and decoding
To encode, shift each letter forward by your chosen number. To decode, shift back by the same amount. For example, with a shift of 3, “HELLO” becomes “KHOOR”; shifting “KHOOR” back by 3 returns “HELLO”. ROT13 is just a Caesar cipher with a shift of 13.
Why it isn’t secure
There are only 25 possible shifts, so anyone can crack a Caesar cipher by trying them all — or by analysing letter frequency. It’s a fun introduction to cryptography and great for puzzles and escape rooms, but never use it to protect real, sensitive information.
FAQ
What’s the difference between Caesar cipher and ROT13?+
ROT13 is a Caesar cipher with a fixed shift of 13. Because 13 is half of 26, the same operation encodes and decodes.