How each classic cipher works
Caesar cipher — shift the alphabet
The Caesar cipher replaces each letter with the one a fixed number of places further down the alphabet, wrapping from Z back to A. Picture two alphabet wheels, one rotated inside the other: with a shift of 3, A becomes D, B becomes E, C becomes F — so the word abc encodes to def. In arithmetic terms, each letter's position (A=0 … Z=25) has the shift added modulo 26: encoding is (p + k) mod 26 and decoding is (p − k) mod 26. Case is preserved and anything that isn't a letter — digits, spaces, punctuation — passes through unchanged. Julius Caesar reportedly used a shift of 3 for his military correspondence, which is why the default shift here is 3.
ROT13 — the self-inverse Caesar
ROT13 is simply a Caesar cipher with a shift of exactly 13 — half of the 26-letter alphabet. That midpoint makes it special: shifting by 13 twice moves every letter 26 places, which lands it right back where it started, so the same operation both encodes and decodes. For example, Hello becomes Uryyb, and running Uryyb through ROT13 again returns Hello. That convenience is why ROT13 became the internet's standard way to hide spoilers and puzzle answers — no key to share, no "encode vs decode" to get wrong.
Vigenère cipher — a keyword of Caesar shifts
The Vigenère cipher strengthens Caesar by using a different shift for each letter, dictated by a repeating keyword. Each key letter stands for its alphabet position (A=0, B=1 … Z=25). To encrypt ATTACKATDAWN with the key LEMON, write the key under the message, repeating it as needed, and add the positions column by column:
| Plaintext | A | T | T | A | C | K | A | T | D | A | W | N |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Key (repeats) | L | E | M | O | N | L | E | M | O | N | L | E |
| Ciphertext | L | X | F | O | P | V | E | F | R | N | H | R |
So ATTACKATDAWN + LEMON → LXFOPVEFRNHR: A shifted by L (11) gives L, T shifted by E (4) gives X, and so on. One important convention this tool follows: only letters consume key letters — spaces, digits and punctuation pass through without advancing the keyword, so "attack at dawn" and "attackatdawn" encrypt their letters identically.
Atbash — the mirror alphabet
Atbash is the oldest trick of all: reverse the alphabet, so A↔Z, B↔Y, C↔X. The word abc becomes zyx. Because the mapping is its own mirror image, Atbash — like ROT13 — is self-inverse: applying it twice restores the original. It dates back to Hebrew scribes around 500 BC, who used it on the Hebrew alphabet in the Book of Jeremiah.
The four alphabets side by side
| Cipher | Alphabet (A–Z maps to…) |
|---|---|
| Plain | ABCDEFGHIJKLMNOPQRSTUVWXYZ |
| Caesar +3 | DEFGHIJKLMNOPQRSTUVWXYZABC |
| ROT13 | NOPQRSTUVWXYZABCDEFGHIJKLM |
| Atbash | ZYXWVUTSRQPONMLKJIHGFEDCBA |
A little history
Caesar's cipher is named for Julius Caesar, who — according to Suetonius — used a three-place shift to protect military messages around 50 BC. It stayed genuinely useful for centuries only because most adversaries couldn't read at all. The Vigenère cipher, popularised in the 16th century, resisted attack for so long it earned the nickname le chiffre indéchiffrable — "the indecipherable cipher." That reputation ended in 1863, when Friedrich Kasiski published a general method for breaking it: repeated words in the plaintext that happen to align with the same part of the key produce repeated fragments in the ciphertext, and the distances between those repeats betray the keyword's length. From there, each key position reduces to a simple Caesar cipher that frequency analysis cracks letter by letter.
These are puzzles, not security
To be clear: every cipher on this page is trivially breakable and should never protect anything that matters. Caesar falls to 25 guesses, Vigenère to a weekend of pen-and-paper analysis, and Atbash and ROT13 aren't even trying — they have no key at all. They're wonderful for escape rooms, geocaching, classroom exercises and treasure hunts, and that's where they should stay. If you need to actually protect a message or a file, use the AES text & file encryption tool, which uses the same encryption standard that banks and governments rely on. And if you're after a different kind of classic encoding, try the Morse code translator — dots and dashes, with audio playback.
Frequently asked questions
- How do I decode a Caesar cipher without knowing the shift?
- Brute-force it — there are only 25 possible shifts. Paste the message above, choose Caesar, and the tool automatically lists all 25 shifted versions below the result. Scan the list for the row that reads as plain language; that row's shift is the key. This works every time, which is exactly why the Caesar cipher offers no real secrecy.
- What is ROT13 used for?
- ROT13 shifts every letter 13 places, so applying it twice returns the original text. It is used to hide spoilers, puzzle answers, hints and punchlines in forums and newsgroups — anyone can reveal the text, but only deliberately. It was never meant to be secure; it is the digital equivalent of printing an answer upside down.
- How does a Vigenère cipher work?
- Vigenère uses a keyword to apply a different Caesar shift to each letter. Each key letter stands for its alphabet position (A=0, B=1, … Z=25), and the keyword repeats for the length of the message. For example, encrypting ATTACKATDAWN with the key LEMON gives LXFOPVEFRNHR: the first letter is shifted by L (11), the second by E (4), and so on.
- How do you crack a Vigenère cipher?
- First find the keyword length, then break each position as a simple Caesar cipher. The Kasiski examination looks for repeated fragments in the ciphertext — the distances between them are usually multiples of the key length. Once the length is known, every Nth letter was shifted by the same amount, so frequency analysis (E is the most common English letter) recovers each key letter one at a time.
- Is the Caesar cipher secure?
- No. With only 25 possible keys, anyone can try every shift by hand in a few minutes — or instantly with the brute-force list on this page. Even without brute force, frequency analysis reveals the shift from a few sentences of text. Use it for puzzles, teaching and games, never to protect real information.
- What is the difference between a classic cipher and modern encryption?
- Classic ciphers like Caesar and Vigenère only shift or rearrange letters and can be broken with pen and paper. Modern encryption such as AES-256 uses keys with more possible values than there are atoms in the observable universe and has survived decades of public cryptanalysis. If you actually need to protect data, use real encryption — not a letter substitution.