Playfair Cipher Decoder
Decode a message written in the Playfair cipher right in your browser, or switch to any other classical cipher.
Input
Output
Guide
How do you decode the Playfair cipher?
To decode a Playfair message, rebuild the 5 × 5 square from the keyword and run the pair rules backward. Two letters in the same row each move one place left, and two in the same column one place up. Two letters in different rows and columns swap to the other corners of their rectangle, as when encoding. With the keyword PICNIC, the sample's first pair, XL, sits in one column, so each letter moves up one place, which gives SE. Without the keyword, the square can't be rebuilt.
Tool description
Drop the Playfair cipher text into the Cipher text box, then add its Keyword. The Plain text box shows the result while you type, in capital letters without spaces. Capitals and small letters both work, and anything that isn't a letter A to Z is skipped, so the pairs can be written apart, run together or split over lines. A J reads as I. With the Keyword left empty, as it starts, the tool decodes with the plain alphabet square. Insert sample loads XL FX UZ NU QM BC IU OI YF LZ MA along with the keyword PICNIC. The result is SEEYOUATTHEPARKATNOXON. To answer in Playfair, use the swap button between the boxes, which turns the tool around with the result as the input, or go to the Playfair Cipher Encoder. Your message is decoded right in your browser.
Examples
| Cipher text | Keyword | Plain text |
|---|---|---|
KF BL BX KN QN IE FH DN SK OW |
TULIPS |
HELXLOFROMTHEGARDENX |
LR EA OL AD CG DS OM FB AP RC NB IB |
SURPRISE |
HIDETHECAKEINTHECUPBOARD |
UM PV QV EG KM AG IZ HZ MY DQ |
SUMMER |
SUNXNYSKIESALXLWEXEK |
DB KY HF NF RB AV IG CU KX BV |
CONFETTI |
BALXLOONSATXTHEPARTY |
Reading the decoded text
- Put the spaces back where the words end:
SEEYOUATTHEPARKATNOXONreads assee you at the park at noon. - Take out the X's added while encoding: one goes between two same letters, like the X in
NOXON, even across a word gap, as inATXTHEforat the, and one can end the text. Where the letter before it is an X, the filler is a Q. Nothing marks the fillers, so tell them from real X's by sense. - Read I as J where a word needs it, as the square has no J:
IAMIARisjam jar. - Digits and punctuation don't come back, as the encoder drops them.
How to recognize Playfair cipher text
- Letters only, usually capitals in pairs, and always an even number of them.
- No J, and never a pair of two same letters, such as
EE. - A pair and its reverse stand for reversed pairs. With
PICNIC,REbecomesSDandERbecomesDS, so when bothSDandDSturn up, they likely stand for a common pair and its reverse.
How to find the keyword
- There are far too many squares to try them all. The Cipher Identifier spots the signs above and names the Playfair cipher, but it can't decode it.
- Try theme words as the Keyword: the puzzle's title, its subject or a word from a hint. A wrong keyword gives a jumble, and the right one gives words, maybe with a few extra X's.
What the error means
Without its last letter, the first example, KF BL BX KN QN IE FH DN SK O, shows "Playfair cipher text has an even number of letters, but this text has 19." Every pair has two letters, so look for a letter lost or added while copying. Digits and punctuation aren't counted, so they don't cause it, but the letters of words pasted along with the message are. A wrong keyword doesn't cause it either. It just gives nonsense.