How this calculator works
A Caesar cipher replaces every letter with the letter a fixed number of places further along the alphabet. With a shift of 3, A becomes D, B becomes E and Z wraps around to C. Decoding applies the same move in reverse. Letters outside the chosen alphabet, such as spaces, punctuation, digits and accented characters, are left untouched so the shape of the message stays readable. The table of all shifts is a brute-force crack: a Caesar cipher has only as many keys as the alphabet has letters, so the plaintext is usually obvious at a glance.
Formula
encoded letter = alphabet[(position of the plaintext letter + shift) modulo alphabet length]. Decoded letter = alphabet[(position - shift) modulo alphabet length]. The Latin alphabet has 26 letters, Cyrillic has 33, Greek has 24, Hebrew has 22 and Arabic has 28.
Worked example
Encoding "Hello, World!" with a shift of 3 gives "Khoor, Zruog!". H moves to K, e to h, l to o, and the comma and space stay where they are. Decoding "Khoor, Zruog!" with a shift of 3 returns the original. A shift of 26 in the Latin alphabet changes nothing, because every letter wraps back to itself.
Advertisement
Frequently asked questions
Is a Caesar cipher secure?
No. There are only 26 possible shifts in English, so anyone can try them all by hand or with a script. A Caesar cipher is a teaching tool and a puzzle mechanism, not a way to protect a secret. Modern encryption uses a key space far too large to search and resists frequency analysis.
Why does my accented text not change?
The alphabets here are limited to their basic letters. Accented Latin characters such as é or ü, and letters from other scripts, pass through unchanged. That keeps the tool predictable, but it also means a mixed-script message is only partly encoded.
How do I break a Caesar cipher without the key?
Use the table of all shifts. One row will look like a language rather than nonsense. In a longer message, you can also count letters: E is the most common letter in English, so the most common ciphertext letter is probably E and the gap between them gives the shift.
Does the shift have to be positive?
No. A negative shift is the same as a positive shift in the other direction, and decoding is simply the opposite sign. The result is reduced modulo the alphabet length, so a shift of 29 in Latin is the same as a shift of 3.