Skip to main content

Cipher Decoder

Decode Caesar, Vigenère, Atbash and other classical ciphers, or let it guess the cipher.

Auto-decode

Examples

Mode

Pick one to see how auto-decode reads it.

Runs in your browser; nothing you enter leaves this page.

How it works

Auto-decode

The text is tried against every cipher the tool knows. Codes and encodings are tried when the text only uses their symbols: dots and dashes for Morse, 0 and 1 for binary, hex digits, the Base64 and Base32 alphabets, A and B for Bacon, numbers for A1Z26.

Letter ciphers are tried with every key: all 25 Caesar shifts, Atbash, ROT47, all 286 Affine keys that are not plain shifts and Rail fence with 2 to 8 rails. Each reading gets an English-likeness score, and the best eight distinct outputs are listed, highest first.

score = 0.6 × max(0, 1 − χ² ÷ 100) + 0.4 × min(1, 3 × share of common English words)

Finding a Vigenère key

For each key length from 2 to 10, the letters are split into that many columns and the index of coincidence of each column is averaged. English sits near 0.066 and random letters near 0.038, so the shortest length within 0.008 of the best average is taken as the key length.

Each column is then a Caesar cipher on its own, and its shifts are ranked by chi-squared distance from English letter frequencies. Columns of a short text are small, so the best few shifts of every column are combined, and the key whose whole decryption reads most like English wins.

IoC = Σ n(n − 1) ÷ (N(N − 1)), over the 26 letter counts n of a column of N letters

Manual

Pick the cipher, the direction and its key: the shift for Caesar, a keyword for Vigenère, a and b for Affine, the number of rails for Rail fence. The output updates as you type, and the drawing on the left shows how each symbol of the input becomes the output.

Open in Manual on any candidate copies its cipher and key across, so you can adjust them.

Affine: y = (a·x + b) mod 26, decoded with x = a⁻¹ (y − b) mod 26

More tools

All 238 tools