Cipher Decoder
Decode messages written in classical ciphers: Atbash, A1Z26, affine, rail fence, columnar transposition, Beaufort, Playfair, Polybius square and Baconian. Pick the cipher, set its key and read the message as you type.
Input
Output
Guide
How do you decode a classical cipher?
To read a message written in a classical cipher, you need to know which cipher it uses and its key, such as a keyword or the number of rails. Decoding then undoes the cipher: it swaps the letters back, puts them back in order, or turns the numbers back into letters. Atbash, A1Z26 and the Polybius square have no key, so knowing the cipher is enough.
Tool description
Paste the message into the Cipher text box, pick its cipher from the Cipher menu and enter the key it was encoded with, and the decoded text appears in the Plain text box as you type. The Cipher Decoder starts on Atbash, and every cipher also has a decoder of its own that starts on it, such as the Playfair Cipher Decoder. Insert sample fills in See you at the park at noon, encoded with the cipher you're on, and sets the key that decodes it. To encode a reply, press the swap button between the boxes, which also moves the result into the input, or use the Cipher Encoder or your cipher's own encoder, such as the Atbash Cipher Encoder.
How to recognize the cipher
| Cipher text looks like | Likely cipher | Bake a cake in it |
|---|---|---|
| Other letters, with words and punctuation in place | Atbash, affine or Beaufort | Yzpv z xzpv (Atbash) |
| The letters of real words, mixed up between the gaps | Rail fence or columnar transposition | Baea e ckka (rail fence, 3 rails) |
| Numbers from 1 to 26, joined by hyphens within a word | A1Z26 | 2-1-11-5 1 3-1-11-5 |
| Pairs of digits from 1 to 5 | Polybius square | 12112515 11 13112515 |
| Capital letters in pairs, no J, no pair of two same letters | Playfair | GP LD PN IO LC (keyword PICNIC) |
| Groups of five A's and B's, or 0s and 1s | Baconian | AAAAB AAAAA ABABA AABAA AAAAA AAABA AAAAA ABABA AABAA |
What decoding reads
- A1Z26 reads numbers joined by hyphens (
8-9 20-15), or split by single spaces or commas, with a slash or a wider gap between words (8 9 / 20 15). Any number from 1 to 26 reads as a letter, so a2that was a digit in the message comes back asB, while 0 and numbers above 26 stay as they are. - Polybius square reads pairs of digits from 1 to 5, with or without spaces between them (
23 24or2324). I and J share a place, so a J comes back as I. - Baconian reads only the A's and B's, in upper or lower case, so the gaps between groups don't matter. Paste only the groups, as the A's and B's of other words count too. A text without any A or B is read in 0s and 1s instead, with 0 for A and 1 for B. In the 24-letter alphabet, a J comes back as I and a V as U.
- Rail fence and columnar transposition leave spaces and punctuation where they are, so a cipher text in groups of five keeps its groups:
SOTAT NEYUT HPRAN OEAEK Owith 3 rails givesSEEYO UATTH EPARK ATNOO N. - Playfair gives capital letters without spaces and keeps the X's added while encoding, as nothing tells them apart from real ones. The sample comes back as
SEEYOUATTHEPARKATNOXON.
What the error messages mean
- Enter a keyword. Columnar transposition and Beaufort need the keyword, and only its letters count, so a keyword of digits alone shows this too.
- Use at least 2 rails. The Rails field is empty, below 2 or not a whole number.
- Playfair cipher text has an even number of letters, but this text has 21. A letter went missing or got added while copying.
- Baconian cipher text comes in groups of five A's and B's, but 4 are left over. An A or B is missing or extra.
- Baconian cipher text is written in A's and B's, or 0s and 1s, but this text has neither. The text isn't in Bacon's code, or its code uses other symbols: write them as A's and B's.
- BBAAB isn't a letter in this alphabet. The group goes past Z. With the 24-letter alphabet, the message may use all 26 letters: switch the Alphabet to 26 letters.
Tips
- Atbash and Beaufort are their own inverses, so decoding them does the same as encoding.
- To find out which cipher a message uses, paste it into the Cipher Identifier. It decodes the ciphers without a key, or with few enough keys to try, right away.
- The Caesar, Vigenère and ROT ciphers have decoders of their own: the Caesar Cipher Decoder, the Vigenere Cipher Decoder and the ROT Cipher Decoder. Pigpen symbols are decoded on the Pigpen Cipher Translator.