CAESAR CIPHER
DECODER
Slide every letter along the alphabet to encode a message - or decode one back. Set the shift, flip to ROT13, or brute-force all 25 to crack a code without the key.
Slide every letter along the alphabet by a fixed amount. Pick a shift (13 is ROT13), or don’t know it - hit Show all 25 shifts to crack it.
PLAY ANOTHER →
Mirror the alphabet - A becomes Z, B becomes Y.
A↔Z MIRRORCODESA1Z26 Cipher DecoderLetters as numbers - A is 1, Z is 26.
A=1 · Z=26CODESRoman Numerals ConverterNumbers the Roman way. 2024 becomes MMXXIV.
MMXXIVCODESBase64 Decoder & EncoderText-safe binary encoding - decode or encode Base64 instantly.
RFC 4648THE HISTORYÂ â—¢
Named for Julius Caesar, who used it around the 1st century BC to protect military messages, the Caesar cipher shifts every letter a fixed number of places along the alphabet. It is one of the oldest and simplest substitution ciphers - and, with only 25 possible shifts, one of the easiest to break.
THE LONG ANSWERÂ â—¢
This cipher is named after a man who demonstrably used it, and we have the key in writing. Both a named user and a surviving description is a rare pairing for a cipher this old.
Suetonius, in Life of Julius Caesar 56, says Caesar wrote confidential material in cipher "by so changing the order of the letters of the alphabet, that not a word could be made out", and then tells you how to read it: substitute the fourth letter, D, for A (LacusCurtius, University of Chicago). D is the fourth letter, so the gap is three, and that is why the selector above starts at 3.
There is a genuine crux in the wording, though. Suetonius is telling the decipherer what to do: put D where you see A. Read strictly, that makes decryption the forward shift and Caesar's own encryption the backward one, so a plaintext D would have gone out as an A. Most retellings, ours included, flip it to "A becomes D" because that is the version you can use. Worth knowing the passage does not quite say it.
Key Takeaways
- Suetonius records the method at Life of Julius Caesar 56, including the key.
- A becomes D, so the shift is three.
- He printed the key in a popular biography, which is our reason for thinking it was long dead as tradecraft.
- Al-Kindi's treatise of around 850 AD set out frequency analysis and made this whole family breakable.
- Singh gives E at roughly 12.7% of English letters, and J, Q, X and Z together at under 1%. That gap is the weapon.
What does Suetonius actually say?
That Caesar used cipher for anything confidential, and that the way in is to move every letter back by the same amount he moved it forward. His example is D standing for A.
Two things in that passage are worth more than the cipher itself.
The first is that he printed the key, in a biography written for a general audience generations after Caesar died. Our reading: nobody publishes a working key, so by the time Suetonius was writing this was history rather than tradecraft. That is an inference from the fact of publication, not something Suetonius says.
The second is his description: "changing the order of the letters of the alphabet". Read loosely that covers substitution in general and not only shifting, though the standard reading is that it describes exactly the shift he then specifies. We raise it because the neat categories we sort ciphers into arrived long after the ciphers.
Why did the Caesar cipher hold for nine centuries?
Not because it was strong. Because nobody had written down how to attack it.
Twenty-five shifts is not a keyspace. You can exhaust it by hand in a couple of minutes, which is exactly what Show all 25 shifts does on this page, and that was equally true in 50 BC. The arithmetic never changed.
What changed is that someone had to think of the attack, write it down, and have it circulate. Until then a shifted alphabet just looked like nonsense, and looking like nonsense was enough. That's the honest reason this survived: the absence of a codebreaking literature, not the presence of security.
The manuscript that ended it
Around 850 AD, al-Kindi wrote A Manuscript on Deciphering Cryptographic Messages. Singh calls it the earliest known systematic account of codebreaking, and it made this entire family of ciphers breakable (Simon Singh).
His observation was that letters appear with characteristic frequencies in a language, and that substitution changes the labels while leaving the frequencies exactly where they were. Singh gives the English figures: E accounts for roughly 12.7% of letters, while J, Q, X and Z together represent less than 1% (Simon Singh). Those numbers shift a little with the corpus you count, but the gap does not.
So you count. The most common letter in a long enough ciphertext is almost certainly E, the next is probably T, and the rest unravels from there. No key needed, no guessing.
Singh has al-Kindi as director of the House of Wisdom in Baghdad, and describes the method as the earliest known discussion of statistics. It arrived as a by-product of counting things carefully.
Then the manuscript vanished for centuries and was rediscovered in the Sulaimaniyyah Ottoman Archive in Istanbul. Which is why "breakable" and "broken" are different words: the technique existed from the ninth century, and monoalphabetic substitution stayed in European use for hundreds of years anyway, because the people using it had not read this.
So why teach it at all?
Because it makes three ideas visible in about thirty seconds, and all three are still load-bearing.
- A key is separate from an algorithm. Everyone knows the method; only the shift is secret. That separation is the whole of modern cryptography.
- Structure survives substitution. The letters change and the pattern of letters does not. Every serious cipher since has been an attempt to destroy that pattern. Atbash is the keyless substitution next door, and A1Z26 is the arithmetic underneath.
- Keyspace size is necessary and nowhere near sufficient. Twenty-five is obviously too few. Being large is not the same as being safe.
That last point is why ROT13 is worth a mention. It's a Caesar shift of 13, which is half of 26, so it's its own inverse: apply it twice and you're back where you started. One operation both encodes and decodes, which makes it handy for hiding spoilers and useless for anything else.
Frequently asked questions
Did Julius Caesar really use this cipher?
Suetonius records it in Life of Julius Caesar 56, saying Caesar wrote confidential material in cipher and that to read it you substitute the fourth letter, D, for A. Both a named user and a surviving description is an unusual pairing for a cipher this old.
What shift did Caesar use?
Three. Suetonius gives D standing for A, and D is the fourth letter of the alphabet, so each letter moves three places along.
Why was the Caesar cipher secure for so long?
It was not strong. Twenty-five shifts can be tried by hand in minutes. What kept shifted alphabets usable was that no method for attacking substitution had been written down and circulated, so ciphertext simply looked like nonsense.
How does frequency analysis break it?
Substitution relabels letters but preserves how often each appears. Singh gives E at roughly 12.7% of English letters and J, Q, X and Z together at under 1%, so counting letters points straight at the likely plaintext. Al-Kindi set the method out around 850 AD.
What is ROT13?
A Caesar cipher with a shift of 13, half of 26, which makes it its own inverse. Applying it twice returns the original text, so a single operation both encodes and decodes.
Set the shift, paste something in, then hit Show all 25 shifts and break your own message. That it takes seconds is roughly the point. The rest of the codes are next door.
Sources
- Suetonius, Life of Julius Caesar 56, LacusCurtius, University of Chicago - retrieved 30 July 2026, https://penelope.uchicago.edu/Thayer/E/Roman/Texts/Suetonius/12Caesars/Julius*.html
- Simon Singh, Arab Code Breakers - retrieved 30 July 2026, https://simonsingh.net/media/articles/maths-and-science/arab-code-breakers/