Encode and decode messages with the Caesar cipher
This tool applies the Caesar cipher to your text in either direction. Pick a shift from 1 to 25 and every letter moves that many places along the alphabet. It also works as a Caesar cipher decoder when you do not know the shift: it tries all 25 options and puts the most likely one at the top.
According to ancient writers, Julius Caesar used a method like this in his letters, with a shift of three. The name has stuck.
How to use it
- Choose a direction: "Encode" or "Decode".
- Type or paste your message into the "Text" box. The "Result" updates with every key you press.
- Move the "Shift" slider, or click "Caesar (shift 3)" or "ROT13 (shift 13)".
- Tick "Also shift digits (ROT5)" and "Remove accents first" if you need them.
- Click "Copy result". The "Use result, reverse direction" button moves the result back into the text box and flips the direction, so you can check that you get your original message back.
Case, spaces and punctuation are kept. With ROT5, each digit moves 5 places: 0 becomes 5, 7 becomes 2.
How it works, with an exact example
With a shift of 3, A becomes D, B becomes E, and the end of the alphabet wraps round to the start: X becomes A, Y becomes B, Z becomes C. The word Hello turns into Khoor. To decode, you move back the same number of places.
The "Cipher wheel" shows this mapping. The outer ring holds the plain alphabet and the inner ring the cipher alphabet, which turns as you change the shift. With ROT5 and a shift of 3, Meet at 10:45 becomes Phhw dw 65:90.
ROT13: the shift that undoes itself
ROT13 is simply the Caesar cipher with a shift of 13. Because the alphabet has 26 letters, applying ROT13 twice gives you back the original text, so the same step both encodes and decodes. Hello, World! becomes Uryyb, Jbeyq! and the other way round. Forums use it to hide puzzle answers and spoilers.
Why the Caesar cipher is so easy to break
There are only 25 useful shifts. You can try them all and keep the one that reads as real words. That is exactly what the "Decode without knowing the shift" section does.
The tool compares the letters of each attempt with the usual letter frequencies of the chosen language. In English, E is the most common letter, followed by T, A, O, I and N. The score shown is a chi-squared value, which measures the gap between the letters you have and the letters you would expect. The lower it is, the more English the text looks. Pick the right "Language of the text". The "Apply" button on any line switches to "Decode" with that shift.
With two full sentences, the right shift nearly always comes first. Under 20 letters, the tool warns you that the ranking is unreliable.
What people use it for today
The Caesar cipher no longer protects anything. It is still a favourite for treasure hunts, scout trails, geocaching puzzles, escape rooms and party games, where a printed cipher wheel often comes with the coded clue. In class it is a gentle first step into cryptography. To protect real data, use modern encryption such as AES.
Frequently asked questions
How do I decode a Caesar cipher without the shift?
Paste the message into the "Text" box and look at the "Decode without knowing the shift" list. The line marked "Most likely" gives the shift and a preview.
Is decoding with 3 the same as encoding with 23?
Yes. Moving back 3 places is the same as moving forward 23. Khoor decoded with 3 or encoded with 23 gives Hello either way.
Why do my accented letters stay the same?
The Caesar cipher works on the 26 letters of the Latin alphabet. A letter like é is not one of them, so it is left as it is. Tick "Remove accents first" to turn it into e and shift it.