How to Use This Tool
Type text and choose a shift, or press "guess the key" and let frequency analysis find it. The panel underneath shows all 25 shifts, which is the fastest way to read anything encoded this way.
How it works
Each letter moves a fixed number of places along the alphabet, wrapping round at the end. A shift of 3 turns A into D, B into E, and Z into C. Decoding is the same operation with the shift reversed.
Non-letters are left alone, which preserves the shape of the text — word lengths, punctuation, capitalisation. That is convenient and it is also a weakness, because word shape alone gives away a great deal about the content.
Why it is not encryption
Two reasons, and either would be enough:
- There are 25 keys. Trying all of them takes no cleverness and no computer — this page does it below and you can read the answer off the list.
- Frequency survives the shift. English is about 12.7% E, 9.1% T and 8.2% A. Shifting the alphabet moves that distribution sideways without flattening it, so the most common letter in the ciphertext is almost certainly a shifted E, and subtracting gives the key directly.
The second attack works on a couple of sentences and is what the "guess the key" button does. Longer text makes it more certain, not less.
ROT13, and what it was for
ROT13 is a shift of 13. Because 13 is exactly half of 26, applying it twice returns the original, so one function serves as both encoder and decoder.
It was never meant to hide anything from someone trying. Its purpose on Usenet was to stop a punchline or a spoiler being read accidentally while scrolling, while remaining trivially readable by anyone who wanted it. Judged against that, it works perfectly — and it is still the right tool for that job today.
What to use when it matters
If you need text to be unreadable by someone who has it, you need real encryption with a key that is
not one of 25 possibilities. In a browser, crypto.subtle provides AES; in practice, using an
established library or an encrypted channel is better than assembling it yourself, because the mistakes
in real cryptography are not in the algorithm.
The useful thing a Caesar cipher teaches is what a key space is. Twenty-five keys is nothing; a 256-bit key is more possibilities than there are atoms in the observable universe. The difference between those two numbers is the entire subject.
