The keyword Polybius square is a classic cipher that maps each letter to a pair of coordinates in a 5×5 grid. Adding a keyword scrambles the grid so the coordinates are not the same as a plain alphabetical Polybius square, making it a popular building block in puzzle hunts and historical cryptography. This tool builds the keyed grid and encodes text locally in your browser.
How it works
First the keyword’s letters are written into the grid left-to-right, top-to-bottom, skipping any letter that already appeared. Then the remaining letters of the alphabet (in order) fill the leftover cells. Because the square has only 25 cells, J is merged with I.
For the keyword GERA, the grid begins G E R A and then continues with B C D F H...:
1 2 3 4 5
1 G E R A B
2 C D F H I
3 K L M N O
4 P Q S T U
5 V W X Y Z
To encode a letter you read its row then its column. A sits at row 1, column 4, so it becomes 14. The full message is a stream of two-digit pairs.
Tips and example
With the keyword GERA, the word HIDE encodes as:
- H → row 2, col 4 →
24 - I → row 2, col 5 →
25 - D → row 2, col 2 →
22 - E → row 1, col 2 →
12
Choose a memorable keyword and keep it secret — anyone with the keyword can rebuild the identical grid and decode instantly. Letters not in the grid (and the letter J, which maps to I) are normalised before lookup.