# Caesar Cipher Decoder

> Decode a Caesar shift cipher without knowing the key. All 25 shifts are tried and the most English-looking one is highlighted.

- Page: https://decoder.tools/caesar-cipher-decoder
- Category: Classical & Obfuscated Ciphers
- Status: live, runs in the browser
- Last reviewed: 2026-10-23

A Caesar cipher decoder recovers text that was encrypted by shifting every letter a fixed number of places in the alphabet. There are only 25 possible shifts, so the decoder simply tries them all and picks the one that reads like English.

## Example

```text Input
Wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj
```

```text Output
ROT23  The quick brown fox jumps over the lazy dog
Best guess: ROT23 (encoded with a shift of 3)
```

The tool lists all 25 candidates. The best guess comes from comparing each one with English letter frequencies, so it is reliable for a sentence but can miss on a single short word. Scan the list in that case.

## How the Caesar cipher works

Each letter is replaced by the letter `k` positions further along, wrapping from Z back to A. With a shift of 3 (the one Julius Caesar reportedly used), A becomes D, B becomes E and Z becomes C:

| Plain | A | B | C | … | X | Y | Z |
|---|---|---|---|---|---|---|---|
| Shift 3 | D | E | F | … | A | B | C |

As formulas, with letters numbered 0–25: encryption is `E(x) = (x + k) mod 26`, decryption is `D(x) = (x − k) mod 26`. Decrypting a shift of 3 is the same as shifting forward by 23, which is why the answer above appears on the **ROT23** line.

ROT13 is the special case `k = 13`.

## How to recognize a Caesar cipher

- Only letters change. Spaces, punctuation, digits and word lengths stay the same.
- Letter frequencies look like English, just moved. The most common ciphertext letter is often `E` shifted.
- A three-letter word that repeats a lot is probably `the`, and that tells you the shift directly: `wkh` means a shift of 3.

## How to use the Caesar cipher decoder

1. Paste the ciphertext.
2. Read the **Best guess** line, then find that shift in the list.
3. For very short messages, scan all 25 lines for the readable one.

## Brute-force a Caesar cipher in code

```python Python
def shift(text, k):
    return "".join(
        chr((ord(c) - b + k) % 26 + b) if c.isalpha() else c
        for c in text
        for b in [65 if c.isupper() else 97]
    )

for k in range(1, 26):
    print(k, shift("Wkh txlfn eurzq ira", k))
```

## At a glance

| | |
|---|---|
| Type | Monoalphabetic substitution (shift) |
| Key space | 25 useful shifts |
| Decrypt shift k | Shift forward by 26 − k |
| Broken by | Brute force or frequency analysis, instantly |

## FAQ

### How do I decode a Caesar cipher without the key?

Try all 25 shifts and pick the one that makes sense. That's what this tool does, and the English-frequency ranking usually picks it for you.

### Why does the answer appear on a different number than the shift?

The list shows how far each line was shifted forward. Undoing a shift of 3 means shifting forward by 23, so text encoded with shift 3 is readable on the ROT23 line. The best-guess field gives both numbers.

### What if none of the 25 lines is readable?

It isn't a simple Caesar cipher. If letters repeat with the same word lengths, try [Atbash](/atbash-affine-decoder). If the same letter encrypts differently in different places, it's probably [Vigenère](/vigenere-decoder). If it's only A and B, try [Baconian](/baconian-cipher-decoder).

### Does it work for other languages?

The shifting works on any text in the 26-letter Latin alphabet, and the readable line will still be in the list. The best-guess ranking uses English letter frequencies, so it is less reliable for other languages.
