Before Playfair can encode BALLOON, it needs to deal with the repeated L letters. A pair cannot contain the same letter twice. This example shows where the tool adds a filler and how that changes the text you get back when decoding.
1. Build the MONARCHY square
| Row | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| 1 | M | O | N | A | R |
| 2 | C | H | Y | B | D |
| 3 | E | F | G | I | K |
| 4 | L | P | Q | S | T |
| 5 | U | V | W | X | Z |
MONARCHY has no repeated letters. Add the unused letters of the alphabet, with J sharing Iās cell, to fill the square. We will keep this square for both encoding and decoding.
2. Form the prepared pairs
| Step | Read | Action | Prepared pair |
|---|---|---|---|
| 1 | B A | Different letters: consume both | BA |
| 2 | L L | Insert X after the first L; reconsider the second L | LX |
| 3 | L O | Different letters: consume both | LO |
| 4 | O N | Different letters: consume both | ON |
The seven-letter word BALLOON is now the eight-letter prepared text BALXLOON. The added X separates the L letters, allowing the tool to work through four valid pairs.
3. Transform the four pairs
| Pair | Rule | Output |
|---|---|---|
| BA | Same column: move down | IB |
| LX | Rectangle: keep rows, exchange columns | SU |
| LO | Rectangle: keep rows, exchange columns | PM |
| ON | Same row: move right | NA |
Encode the prepared pairs
BALLOONKey MONARCHY; prepared BA LX LO ONIBSUPMNA4. Decode without removing possible fillers
IBSUPMNA decodes to BA LX LO ON, or BALXLOON. The decoder keeps the X because it cannot tell whether that letter was added or was part of an original word. If you reconstruct BALLOON from the result, keep that interpretation separate from the decoded text.
An X needs a different filler
For repeated XX, the tool inserts Q instead of X. A final unmatched X also gets Q; other repeated or unmatched letters use X. This avoids creating another pair of identical letters.
Your turn
Prepare TAX before encryption. Does it receive X or Q at the end?