How to use the Caesar cipher tool
- Type or paste your message into Text to encode or decode.
- Enter the Shift. Julius Caesar used 3, so A becomes D. Any whole number works, and numbers outside 1 to 25 wrap around, so shift 29 behaves like shift 3.
- Press Encode to scramble the message or Decode to read one. The Result box updates as you type, and the alphabet strip under it shows which letter turns into which.
- Do not know the shift? Choose Decode and tick Show all 25 shifts (brute force). Every possible decoding is listed, and when there is enough English text the tool marks the most likely one.
- Press Copy result. In the all-shifts view it copies all 25 lines.
How the Caesar cipher works
Number the letters A to Z as 0 to 25. Encoding adds the shift and wraps around after Z: E(x) = (x + n) mod 26. Decoding subtracts it: D(x) = (x - n) mod 26. Upper and lower case are kept, and anything that is not one of the 26 letters (digits, spaces, punctuation, accents) passes through unchanged. The Roman historian Suetonius describes Caesar writing private letters with each letter replaced by the one three places later (Life of Julius Caesar, section 56). The general formula is on the Caesar cipher page.
With only 25 useful shifts, trying all of them takes an instant. To pick the likely winner, the tool scores each decoding by how closely its letters match English letter frequencies (E 12.7%, T 9.1%, A 8.2%, from Letter frequency) and rewards common words such as "the" and "and". It stays silent when the text has fewer than 8 letters or two shifts score too close to call.
Worked example
The tool opens with Hello World, Encode, shift 3, and shows:
Khoor Zruog
H moves three places to K, e to h, both l to o, o to r, and W to Z, o to r, r to u, l to o, d to g. To undo it, paste Khoor Zruog, choose Decode with shift 3, and Hello World comes back. The status line reads "Encoded 10 letters with shift 3."
Limits and edge cases
Only the English letters A to Z move. At shift 3, Café becomes Fdié, because é is left as typed, and the status line tells you how many such letters it skipped. The most likely guess assumes English and can be fooled by very short or unusual text, so check the highlighted line yourself. The cipher is a puzzle, not protection: use real encryption for secrets. Shift 13 is the ROT13 Cipher. For other classic encodings, try the Morse Code Translator, the Binary to Text Converter or the Base64 Decoder and Encoder.
Frequently asked questions
How do I decode a Caesar cipher without the key?
Choose Decode and tick Show all 25 shifts. Look for the line that reads as normal words. With enough English text, the tool marks the most likely shift for you.
What shift did Julius Caesar use?
A shift of 3, so A became D, according to the Roman historian Suetonius.
Is ROT13 a Caesar cipher?
Yes. ROT13 is a Caesar cipher with a shift of 13. The alphabet has 26 letters, so applying it twice returns the original text and encoding and decoding are the same step.
Is the Caesar cipher secure?
No. It has only 25 usable keys and keeps letter frequencies, so anyone can break it in seconds. Use it for puzzles, geocaches, classroom lessons and CTF warm-ups, not for secrets.
What happens to numbers, punctuation and accented letters?
They pass through unchanged. Only the letters A to Z are shifted, and upper and lower case are kept.
Sources: Suetonius, Life of Julius Caesar 56; Wikipedia, Caesar cipher and Letter frequency. The tool runs in your browser and your text is not uploaded.