Skip to tool
ecech.
💻 Developer & Code

Caesar Cipher, With All 25 Keys Tried For You to Show Why It Is Not Encryption

There are only 25 possible shifts, so breaking it takes no cleverness. Letter frequency finds the key on longer text without even trying them all.

This is not encryption. There are 25 keys and this page tries them all below. Use it for puzzles, spoiler-hiding and teaching — never for anything you need kept private.

Every possible shift

Letter frequency in your text

Advertisement

How the calculation works

Why frequency analysis breaks it instantly English letter frequency E E is about 12.7% and towers over everything The same text shifted by 3 H the peak just moved — H minus E is the key

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.

Why ROT13 is its own decoder Hello → ROT13 → Uryyb → ROT13 → Hello 13 + 13 = 26, which is a full lap of the alphabet. So one function both encodes and decodes, which is exactly what a spoiler tag needs.
Not a security property — a convenience one, and the reason ROT13 outlived its context.

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.

Advertisement

Frequently Asked Questions

Is a Caesar cipher secure?
No, and it never was against a determined reader. There are only 25 possible keys, so trying every one takes seconds by hand — this page does it for you. Letter frequency finds the key faster still on anything longer than a sentence.
How do you break a Caesar cipher?
Either try all 25 shifts and read the one that makes sense, or use frequency analysis: English is about 12.7% E, and shifting the alphabet moves that peak without flattening it, so the most common ciphertext letter minus E gives the key directly.
What is ROT13?
A Caesar cipher with a shift of 13. Because 13 is half of 26, applying it twice returns the original text, so the same function encodes and decodes. It was used on Usenet to hide punchlines and spoilers from accidental reading, never to keep anything private.
Why does ROT13 decode itself?
Because 13 plus 13 is 26, a complete lap of the alphabet. Any letter shifted 13 places twice arrives back where it started. That is a convenience property rather than a security one, and it is why ROT13 rather than any other shift became the convention.
Does the cipher change numbers and punctuation?
No, only letters are shifted. That preserves word lengths, capitalisation and punctuation, which makes the text readable in shape even when unreadable in content — and gives away a great deal to anyone trying to break it.
What should I use if I actually need to hide something?
Real encryption with a key that is not one of 25 possibilities. Browsers provide AES through crypto.subtle, though using an established library or an encrypted channel is safer than assembling it yourself — the mistakes in cryptography are rarely in the algorithm.

Related tools in Developer & Code

Browse all Developer & Code tools
The desk where ecech. tools get written: a laptop, a notebook of to-dos and a whiteboard listing the tools on the site.

Made by one person

ecech. is not a content farm. Every tool here is written and checked by hand, one at a time, by someone who wanted the tool to exist and could not find a version that showed its working.

No accounts and no sign-in, and nothing you type reaches a server — every calculation on this page runs inside your browser. The ads are served by Google and do set their own cookies, which is set out in full on the privacy page. More about the site.