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

Row12345
1MONAR
2CHYBD
3EFGIK
4LPQST
5UVWXZ

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

StepReadActionPrepared pair
1B ADifferent letters: consume bothBA
2L LInsert X after the first L; reconsider the second LLX
3L ODifferent letters: consume bothLO
4O NDifferent letters: consume bothON

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

PairRuleOutput
BASame column: move downIB
LXRectangle: keep rows, exchange columnsSU
LORectangle: keep rows, exchange columnsPM
ONSame row: move rightNA

Encode the prepared pairs

InputBALLOON
SettingsKey MONARCHY; prepared BA LX LO ON
Expected resultIBSUPMNA
Try this method

4. 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?

Continue the lesson

Playfair cipher toolHow text conversion and preparation workCheck a puzzle before printing