
How to Use the Caesar Cipher Decoder

- Choose Decode to crack a message, or Encode to hide your own text with a shift.
- Paste the ciphertext. Case, numbers and punctuation are kept exactly as they are.
- Set the shift with the minus and plus buttons if you already know the key.
- No key? Press Auto-detect shift to brute force all 25 shifts and pick the most English result.
- Read the decoded text, then check the best English match and fit score below it.
Paste the ciphertext into the box and leave the mode on Decode. If you know the shift, type it or use the plus and minus buttons, and the decoded plain text appears as you type.
If you do not know the shift, press Auto-detect shift. The tool quickly tries every shift, scores each result against normal English letter frequencies and selects the best match, all locally inside your own browser.
The full ranked list of all 25 shifts sits under the tool, with a Use button on each row. To encode instead, switch to Encode, type your message, choose a shift and then press Copy.
What Is a Caesar Cipher
A Caesar cipher, also called a shift cipher, replaces each letter with the letter a fixed number of places further along the alphabet. It is the simplest and probably best known substitution cipher in history.
With a shift of 3, A becomes D, B becomes E, and X wraps around to A. Every letter moves by the same amount, so the message's original pattern stays visible to a careful reader.
The Roman historian Suetonius, in his Life of Julius Caesar, describes Caesar writing confidential letters by putting D in place of A. That is why the cipher still carries the name of Julius Caesar today.
Caesar Cipher Formula
Number the letters from A equals 0 to Z equals 25. Encoding adds the shift, or key, to each letter position, and decoding subtracts it. Taking mod 26 wraps any result back into the alphabet.
decode: P = (C − k) mod 26
where P and C are letter positions (A = 0 … Z = 25) and k is the shift
Because the alphabet has 26 letters, there are only 25 possible shifts. A shift of 0 or 26 returns the original, unchanged text, and decoding with 3 is exactly the same as encoding with 23.
The cipher is symmetric: the sender and receiver share one small secret number. This tool keeps upper and lower case, and leaves digits, spaces and punctuation unchanged, so only the letters A to Z move.
How the Brute Force Ranking Works
A brute force attack simply tries all 25 possible shifts. That takes a computer almost no time, so the real challenge is deciding which result is readable English and which are meaningless strings of letters.
This decoder uses frequency analysis with the chi-squared statistic. For each candidate it counts every letter and compares the counts with typical English letter frequencies, such as E at about 12.7% and T at 9.1%.
expectedi = total letters × English frequency of letter i
A lower score means the letter mix looks more like ordinary English. Real sentences usually score far below every wrong shift, and the results table sorts all candidates from the best fit to the worst.
Worked Example
The message already in the box begins Phhw ph dw wkh rog eulgjh. It holds 69 letters, which is plenty for frequency analysis to work well and pick out the right shift with real confidence.
Decoding with shift 3 gives Meet me at the old bridge near the river at seven tonight. Bring the map and tell no one. Its chi-squared score is about 23.5 in the ranked results table.
The runner-up is shift 22, with a score of about 140.5, and it reads as nonsense. Such a wide gap between first and second place tells you the top ranked shift is almost certainly correct.
ROT13 and Other Common Shifts
Some shifts have their own names or uses. The table shows what the word HELLO becomes under each one, so you can recognize them quickly when they turn up in a puzzle or online forum.
| Shift | Name or use | HELLO becomes |
|---|---|---|
| 1 | Simplest shift, often used in puzzles | IFMMP |
| 3 | Classic Caesar shift | KHOOR |
| 13 | ROT13, its own inverse | URYYB |
| 25 | Same as shifting back by 1 | GDKKN |
ROT13 is special because 13 is exactly half of 26 letters. Applying it twice returns the original text, so it is its own inverse and the very same operation both encodes and decodes a message.
Forums and newsgroups have long used ROT13 to hide spoilers, punchlines and puzzle answers from casual readers. Press the ROT13 button to set the shift to 13 in a single click, whichever mode is active.
Where Caesar Ciphers Are Used
Nobody protects real secrets with a Caesar cipher today, but it is everywhere in games and teaching. Escape rooms, treasure hunts and puzzles use it because players can crack it with a little patient thought.
Capture the flag contests often hide an early clue behind a simple shift, and many video games include similar cipher clues. Teachers use it as the first step into cryptography, before moving to stronger systems.
A Caesar wheel, two nested rings of letters, lets you encode by hand by turning one ring. This decoder does the same job digitally and adds automatic ranking, which a simple paper wheel cannot offer.
Limits and Security
A Caesar cipher is not secure. With only 25 keys, anyone can break it in seconds, so never use it for passwords or private data. For real protection, use algorithms approved in NIST cryptographic standards.
Short messages with fewer than about 20 letters, or text full of names and abbreviations, may not follow normal English frequencies. The top ranked shift can then be wrong, so read the next few rows.
The frequency table is for English, so other languages such as French or Spanish may rank poorly; check the list by eye. If no shift reads well, try a Vigenère or general substitution cipher instead.
Frequently asked questions
How do I decode a Caesar cipher without the key?
Press Auto-detect shift. The tool tries all 25 shifts, ranks them by how closely their letter frequencies match English, and selects the most likely one, which you can confirm in the ranked table.
What is the shift in ROT13?
ROT13 shifts every letter by 13 places. Because the alphabet has 26 letters, applying ROT13 twice returns the original text, so one operation both encodes and decodes.
Is a Caesar cipher secure?
No. There are only 25 possible keys, so it can be broken instantly by brute force. It is useful for puzzles, teaching and escape rooms, not for protecting any real information.
Are numbers and punctuation changed?
No. Only the letters A to Z are shifted. Upper and lower case are preserved, and digits, spaces and symbols stay exactly as they are in the original message.
Why is the top result sometimes wrong?
Very short messages, names or lists do not follow normal English letter frequencies, so the chi-squared ranking can mislead. Check the next few rows of the ranked table for readable text.
Why does decoding with 3 equal encoding with 23?
Shifting back by 3 and forward by 23 land on the same letter, because 3 plus 23 is 26, a full trip around the alphabet. Any shift k and 26 minus k are complementary.