Caesar Cipher Encoder & Decoder
Encode or decode a Caesar shift cipher with any shift from 1 to 25, or press the ROT13 preset. If you do not know the shift, tick brute force and read all 25 possible decodings in a list. Letters keep their case and everything else passes through unchanged. Free, no sign-up, and nothing is uploaded.
Mode
How the Caesar Cipher Works
The Caesar cipher is one of the oldest known encryption techniques, named after Julius Caesar, who used it around 58 BC to protect military correspondence. Each letter is replaced by the letter a fixed number of positions further along the alphabet, wrapping around from Z back to A. With a shift of 3, HELLO becomes KHOOR.
Decoding simply shifts in the opposite direction. Because there are only 25 meaningful shifts, the cipher offers no real security today — but that same weakness makes it a perfect introduction to cryptography, and the brute-force mode above shows exactly how an attacker would break it.
How to Use the Caesar Cipher Tool
- 1. Choose Encode or Decode. Encode shifts letters forward; Decode shifts them back by the same amount.
- 2. Set the shift. Drag the slider or type a number from 1 to 25. The ROT13 preset button sets 13.
- 3. Type or paste your message. The result appears as you type. Letters keep their upper or lower case; digits, spaces, punctuation and accented letters pass through unchanged.
- 4. Don't know the shift? Tick Brute-force mode. The tool applies all 25 decodings and lists them, so you can scan for the line that reads as English.
How the Caesar Cipher Works
Number the letters from 0 (A) to 25 (Z). To encipher with shift k, add k to each letter's number and wrap around past Z: E(x) = (x + k) mod 26. To decipher, subtract: D(x) = (x − k) mod 26. The Roman writer Suetonius, in his life of Julius Caesar, says Caesar wrote confidential letters by putting D for A "and so with the others" — a shift of 3, the version that carries his name.
Plain
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Shift 3
DEFGHIJKLMNOPQRSTUVWXYZABC
ROT13
NOPQRSTUVWXYZABCDEFGHIJKLM
Worked Example
Attack at dawn with a shift of 3 becomes Dwwdfn dw gdzq: A to D, t to w, t to w, a to d, c to f, k to n, and so on, with the spaces untouched. With ROT13 the same message becomes Nggnpx ng qnja, and applying ROT13 again returns Attack at dawn. That is ROT13's useful property: 13 is half of 26, so the same operation both encodes and decodes. It has been used on Usenet and forums to hide spoilers and punchlines, never to keep secrets.
Breaking a Caesar Cipher
Because only 25 shifts change anything, you can try them all. Enter Dwwdfn dw gdzq with brute force ticked and the list runs from Shift 1: Cvvcem cv fcyp through Shift 3: Attack at dawn to Shift 25. The correct line is the only one with real words. For long messages there is a faster check, frequency analysis: E is the commonest letter in English, so the most frequent cipher letter probably stands for E, and the distance between the two gives the shift. The Letter Frequency Counter will count the letters for you.
Note that the brute-force list shows results of decoding, one per possible shift, and does not rank them; you do the reading.
Limits of This Tool
- Only A–Z and a–z are shifted. Accented letters, Cyrillic, Greek and other scripts pass through unchanged, so
Caféwith shift 3 becomesFdié. The cipher is defined on a 26-letter alphabet. - Shift 0 and 26 do nothing, so the slider starts at 1 and stops at 25.
- Not secure. With 25 possible keys, a Caesar cipher protects nothing; use it for puzzles, teaching and games.
Which Cipher Do You Need?
| Cipher | Key | Use it when |
|---|---|---|
| Caesar / ROT13 (this page) | One shift, 1–25 | The message uses one fixed shift |
| Vigenère | A keyword; the shift changes per letter | Letters are shifted by a repeating word |
| Affine | A multiplier and a shift | The message is multiplied, then shifted |
| Atbash | None; the alphabet is reversed | A↔Z, B↔Y |
| Substitution solver | A full scrambled alphabet | Letters map one-to-one with no pattern |
Not sure which cipher you have? The planned Cipher Identifier will suggest a family from the letter statistics.
Frequently Asked Questions
- What is a Caesar cipher?
- A substitution cipher that replaces each letter with the one a fixed number of places further along the alphabet, wrapping from Z to A. With a shift of 3, A becomes D and HELLO becomes KHOOR. It is named for Julius Caesar, whom Suetonius reports using a shift of 3.
- How do I decode a Caesar cipher without knowing the shift?
- Tick Brute-force mode and paste the message. The tool lists all 25 decodings; the one that reads as ordinary language is the answer. Because there are only 25 candidates, this always works for a true Caesar cipher.
- What is ROT13?
- A Caesar cipher with a shift of 13. Since 13 is half the alphabet, applying it twice gives back the original, so one operation both encodes and decodes. Use the ROT13 preset button to set the shift.
- Does the cipher change numbers, spaces or punctuation?
- No. Only the letters A–Z and a–z are shifted, and each keeps its case. Digits, spaces, punctuation and accented letters are left alone.
- How is a Caesar cipher different from a Vigenère cipher?
- A Caesar cipher uses one shift for the whole message. A Vigenère cipher uses a keyword, and each key letter gives a different Caesar shift for the matching message letter, which is why it resisted attack for centuries.
- Is a Caesar cipher secure?
- No. It has 25 keys and falls to brute force instantly, as well as to frequency analysis. It is a good first cipher for learning and puzzles, but must never protect anything private.
- Is my message uploaded?
- No. The shifting happens in your browser as you type and nothing is sent anywhere.