Free online tool
Caesar Cipher Encoder & Decoder
Encrypt a message by shifting every letter a fixed number of places along the alphabet, decrypt one when you know the shift, or crack one you don't by viewing all 25 possibilities at once. The two-thousand-year-old cipher of Julius Caesar, in your browser.
Alphabet map for the current shift
ABCDEFGHIJKLMNOPQRSTUVWXYZ DEFGHIJKLMNOPQRSTUVWXYZABC
Top row: plain alphabet. Bottom row: what each letter becomes. Decrypting reads the rows the other way.
Crack it: all 25 shifts
Paste a Caesar-encrypted text in the box above. One of these rows will be readable; click Use to decrypt with that shift.
Type or paste a cipher text above to see all 25 possible shifts.
How the Caesar cipher works
The Caesar cipher is a substitution cipher: every letter of the message is replaced by the letter a fixed number of positions further along the alphabet. That number is the shift (or key). With a shift of 3, A becomes D, B becomes E, and so on; at the end of the alphabet you wrap around, so X becomes A, Y becomes B and Z becomes C.
To decrypt, shift back by the same amount. Spaces, digits and punctuation are left untouched, which is why the word shapes of the original survive in the ciphertext. With shift 3, HELLO becomes KHOOR; shifting KHOOR back by 3 returns HELLO.
In arithmetic terms, number the letters A=0 … Z=25; encryption is (letter + shift) mod 26 and decryption is (letter − shift) mod 26. That "mod 26" is the wrap-around.
A worked example
| Shift | ATTACK AT DAWN |
|---|---|
| 1 | BUUBDL BU EBXO |
| 3 | DWWDFN DW GDZQ |
| 7 | HAAHJR HA KHDU |
| 13 | NGGNPX NG QNJA |
| 25 | ZSSZBJ ZS CZVM |
Notice that shift 25 is the same as shifting back by 1, and that the double letters (TT) stay double in every row. Patterns like that are exactly what makes the cipher breakable.
ROT13: the special case
ROT13 is a Caesar cipher with a shift of 13. Because the English alphabet has 26 letters, applying ROT13 twice brings you back to the original text, so the same operation both encrypts and decrypts. It has been used since the early days of online forums to hide spoilers, punchlines and puzzle answers: anyone can decode it instantly, but you have to choose to. Press the ROT13 button in the tool to set it.
History: Julius Caesar and Suetonius
The cipher takes its name from Julius Caesar, who, according to the Roman biographer Suetonius in The Twelve Caesars (written around AD 121), protected his private and military correspondence by replacing each letter with the one three places further along the alphabet. Suetonius adds that Caesar's nephew Augustus used a simpler version with a shift of one. For its time it was reasonably effective: most people could not read at all, let alone recognize a transformed Latin text.
Simple shift and substitution ciphers stayed in use for centuries, and in the 9th century the Arab scholar al-Kindi described frequency analysis, the systematic method for breaking them. By the Renaissance, serious secrets had moved to polyalphabetic ciphers like Vigenère's, but the Caesar shift lived on as a teaching example, a child's secret code and, as ROT13, a piece of internet culture.
Why it is weak
- Only 25 keys. There are 25 possible shifts (shift 0 changes nothing). Trying all of them by hand takes a minute; the brute-force panel above does it instantly. That is the whole reason the cipher cannot protect anything.
- Letter frequencies survive. In English, E, T, A and O are the most common letters. In a Caesar ciphertext the most common symbol is almost always E shifted by the key, so a single count reveals the shift without trying any.
- Word shapes survive. Spaces and repeated letters are preserved; a three-letter word with the pattern "XYZ" that appears everywhere is probably "THE".
None of this makes it useless. It is a perfect first cipher for teaching: it introduces keys, modular arithmetic, brute force and frequency analysis in one afternoon. Just never use it for anything you actually want to keep private.
Related ciphers and codes
The Vigenère cipher uses a keyword so the shift changes from letter to letter, defeating simple frequency counts. The Atbash cipher reverses the alphabet (A↔Z, B↔Y). And a code such as Morse or binary is a different thing altogether: it represents letters in another form without hiding them. A cipher conceals; a code transcribes. You can of course combine them, encrypting with Caesar and then sending the result in Morse, which is a classic scout and escape-room puzzle.
FAQ
Frequently asked questions
How do I decode a Caesar cipher without the key?
Try all 25 shifts; one of them will read as plain text. The "Crack it" panel above lists every shift the moment you paste the ciphertext. Alternatively, count the most frequent letter and assume it is E: the distance from E to that letter is the shift.
What shift did Julius Caesar use?
Three, according to Suetonius: A became D, B became E, and so on. His successor Augustus reportedly used a shift of one.
What is the difference between ROT13 and the Caesar cipher?
ROT13 is simply a Caesar cipher with the shift fixed at 13. Because 13 is half of 26, encrypting twice restores the original, so one operation works in both directions.
Does the Caesar cipher change numbers and punctuation?
No. Only the letters A–Z (upper and lower case) are shifted. Spaces, digits and symbols pass through unchanged, which is one of the clues that makes the cipher easy to break.
Is the Caesar cipher secure?
Not at all. With 25 possible keys it can be broken in seconds by hand. Use it for games, puzzles and teaching, never for real secrets.
What is the difference between the Caesar cipher and Morse code?
The Caesar cipher hides a message by changing its letters (encryption). Morse code represents letters as dots and dashes without hiding anything (encoding). One is a cipher, the other a code. Try the Morse code translator to see the difference.
Send your secret in Morse
Encrypt it here, then convert the result to dots and dashes.