Caesar Cipher Encoder and Decoder

Shift every letter through the alphabet by a fixed amount - the oldest substitution cipher there is. Set the shift to 13 and you have ROT13. If you do not know the shift, the brute-force view below solves it for you.

1-25. Shift 13 is ROT13, which encodes and decodes with the same setting.

How the Caesar cipher works

Each letter moves a fixed number of places along the alphabet. At a shift of 3, A becomes D, B becomes E, and the end of the alphabet wraps back to the start, so Z becomes C. Decoding is the same operation in reverse.

Only the 26 letters move. Digits, spaces, punctuation and accented characters pass through untouched, and capitals stay capital - which is convenient, and also one of the reasons the cipher is so easy to break. The shape of the message survives encryption.

The name comes from Julius Caesar, who according to Suetonius used a shift of 3 for his military correspondence. It was genuinely effective at the time, for the unglamorous reason that most of his opponents could not read at all.

ROT13

ROT13 is a Caesar cipher with the shift fixed at 13. Because 13 is exactly half of 26, it is its own inverse: running ROT13 twice returns the original text, so a single button both encodes and decodes.

It was never meant to be secure. On old Usenet groups and on forums since, ROT13 is used to hide punchlines, spoilers and puzzle answers from a casual glance - the point is that reading it has to be deliberate, not that it is hard.

Why it is trivially breakable

There are only 25 useful keys. An attacker does not need to be clever - they try all of them and read the one that is English, which is exactly what the brute-force tab above does in a few milliseconds.

Even without brute force it falls to frequency analysis. Letter frequencies are unchanged by shifting, merely relabelled, so the most common letter in a decent-length English ciphertext is almost always a shifted E. That single observation usually gives up the key. The technique was described by al-Kindi in the 9th century, which makes this cipher comprehensively broken for well over a thousand years.

So treat it as a puzzle, a teaching example or a spoiler tag - never as protection. If you need text that actually resists being read, use the AES encryption tool, which encrypts with a passphrase in the same browser tab and has no known practical break.

Questions

What is a Caesar cipher?

A substitution cipher that shifts every letter of the alphabet by a fixed number of places, wrapping around from Z back to A. The shift amount is the key, and there are only 25 useful values, which is why it is easy to break.

What is ROT13 and how is it different?

ROT13 is a Caesar cipher locked to a shift of 13. Since 13 is half of 26, applying it twice returns the original text, so the same operation both encodes and decodes. It is used to hide spoilers and puzzle answers, not to provide security.

How do I decode a Caesar cipher without knowing the shift?

Try all 25 shifts and read the one that makes sense. The brute-force view on this page does that instantly. For longer texts you can also use frequency analysis: the most common letter in English is E, so whichever letter is most common in the ciphertext is probably a shifted E.

Does it encrypt numbers and punctuation?

No. Only the 26 letters of the alphabet are shifted. Digits, spaces, punctuation and accented characters are passed through unchanged, and upper and lower case are preserved.

Is the Caesar cipher secure enough for real use?

No, and it has not been for over a thousand years. It has 25 possible keys and falls immediately to frequency analysis. Use it for puzzles and teaching. For text that must stay private, use a modern cipher such as AES.

Is my text sent to a server?

No. The shifting happens in your browser in JavaScript. There is no endpoint on this site that receives the text, and you can confirm that in the Network tab of your browser's developer tools.

Related tools

When the puzzle stops being a puzzle

A shift cipher is a good way to understand encryption and a terrible way to do it. Snoq keeps a whole notes database encrypted with AES-256 and Argon2id on your own disk - unlocked once, then it just works. Rich text, tabs, full-text search, PDF export. Free, Windows, no account and no cloud.

Download Snoq for Windows