Playfair Cipher Decoder with Known Keyword
Paste even-length Playfair ciphertext and the original keyword. This example decodes IBSUPMNA with MONARCHY to BALXLOON. Same-row pairs move left, same-column pairs move up, and rectangle pairs exchange columns. The square merges I/J. Possible filler positions are highlighted but remain in the result, since the cipher cannot distinguish inserted fillers from genuine letters. This is a known-key decoder, not an unknown-key breaker.
IBSUPMNA -> IB SU PM NA
every letter paired straight off, nothing dropped and nothing added
- IB -> BAsame column
- SU -> LXrectangle
- PM -> LOrectangle
- NA -> ONsame row
- Direction
- Key
- Digraphs
- 4
- Merge
- I and J
- Filler
Playfair enciphers two letters at a time, so it works on letters only: spaces, punctuation, digits and accented letters are dropped before it starts, J is read as I, a doubled pair is separated by the filler and an odd count is padded. That is why a decode hands back the padded letters rather than your sentence.
1 letter is marked above: each sits where a filler would sit, between two copies of one letter or on the end. That is a guess from the shape of the text and nothing was removed, because a real letter can sit there too.
The keyed square
The key goes in first, letter by letter, skipping any letter already placed; the rest of the alphabet follows. I and J share one cell, which is how 26 letters fit 25 places. Step through the digraphs to see the path each one takes.
| M | O | N | A | R |
| C | H | Y | B | D |
| E | F | G | I/J | K |
| L | P | Q | S | T |
| U | V | W | X | Z |
Digraph 1 of 4: IB becomes BA
Both letters sit in column 4, so each moves one place up, wrapping from the top of the column back to the bottom.
Three worked examples
Common questions
- Why does BALXLOON contain X?
- The encoder inserted X between repeated L letters. Decoding recovers prepared text and keeps candidate fillers. Removing them needs context; spaces, case and J cannot be reconstructed automatically.
- Can this solve Playfair without a keyword?
- No. It needs the known keyword or equivalent square convention. It does not search unknown keys or provide brute-force cryptanalysis.
- Why is an odd ciphertext length an error?
- Playfair encodes pairs, so valid ciphertext contains an even number of letters after the stated normalization. Check for a missing or extra letter and match the original filler convention.
An exact reproduction of the classical 5x5 Playfair rules, with I and J sharing a square and the filler you chose visible in the digraph trace. Decryption returns the padded text and not your original: the cipher cannot tell a filler from a real letter, so BALXLOON comes back and you take the X out yourself. This is a historical cipher for teaching and puzzles and offers no real security.