Caesar Cipher
Encode or decode a Caesar shift cipher — including ROT13 — with letters wrapped and everything else left as is.
Don’t know the key? Scan the rows below for the one that reads as plain text — that shift is the cipher’s key.
- 1GDKKN
- 2FCJJM
- 3EBIIL
- 4DAHHK
- 5CZGGJ
- 6BYFFI
- 7AXEEH
- 8ZWDDG
- 9YVCCF
- 10XUBBE
- 11WTAAD
- 12VSZZC
- 13URYYB
- 14TQXXA
- 15SPWWZ
- 16ROVVY
- 17QNUUX
- 18PMTTW
- 19OLSSV
- 20NKRRU
- 21MJQQT
- 22LIPPS
- 23KHOOR
- 24JGNNQ
- 25IFMMP
A Caesar cipher shifts every letter forward by a fixed key from 0 to 25, wrapping A–Z and a–z around and leaving spaces, digits, and punctuation unchanged. With shift 3, HELLO becomes KHOOR; decoding shifts back to recover HELLO. ROT13 is the special case shift 13, which is its own inverse.
What a Caesar cipher is
The Caesar cipher is one of the oldest known substitution ciphers, named after Julius Caesar, who used it to protect military messages. It replaces each letter with the one a fixed number of positions later in the alphabet. That fixed number is the key, or shift. The rule is simply “move each letter forward by n, and wrap from Z back to A” — for example, with a shift of 3, A → D, B → E, and Z → C. Non-letters such as spaces, numbers, and punctuation are copied through untouched, and uppercase and lowercase are shifted within their own ranges.
Encoding and decoding
Encoding adds the shift; decoding subtracts it. To reverse a message encoded with shift n, you can either subtract n or, equivalently, shift forward by 26 − n. So a message encoded with shift 3 is decoded by shifting back 3 (the same as shifting forward 23). Because the alphabet has 26 letters, shifting by 0 or by 26 leaves the text unchanged.
- 1 Choose Encode or Decode. Encode scrambles plain text; Decode reverses a shifted message back to plain text.
- 2 Set the shift (0–25). Pick your key. The classic Caesar cipher uses 3; ROT13 uses 13.
- 3 Type or paste your text. Enter HELLO. Only letters are shifted — spaces and punctuation pass through.
- 4 Read the result. With Encode and shift 3, each letter moves forward three places: H → K, E → H, L → O, L → O, O → R, giving KHOOR.
- 5 Reverse it to check. Switch to Decode with the same shift 3 and paste KHOOR to get HELLO back.
How a shift of 3 maps the alphabet
Each letter moves forward three places and wraps at the end. ROT13 (shift 13) is shown for comparison.
| Plain | Shift 3 | ROT13 (shift 13) |
|---|---|---|
| A | D | N |
| B | E | O |
| C | F | P |
| H | K | U |
| X | A | K |
| Y | B | L |
| Z | C | M |
Why it is easy to break
A Caesar cipher has only 25 useful keys (a shift of 0 changes nothing), so an attacker can simply try all of them and read whichever result makes sense — a brute-force attack that takes seconds. Even without trying every key, frequency analysis reveals the shift quickly: because each letter always maps to the same substitute, the most common letter in the ciphertext usually corresponds to E in English. For these reasons the Caesar cipher is a teaching tool and a puzzle, not real security. ROT13, the shift-13 variant, is popular precisely because it is its own inverse — applying it twice returns the original text — so it is used to lightly obscure spoilers and puzzle answers rather than to protect anything.