UTILS.
100% in-browser
🔲

Polybius Square Cipher Encoder / Decoder

Convert letters to two-digit row/column coordinates on a 5×5 Polybius square (basis of the tap code). Keyword-seeded squares and I/J or C/K merge supported.

— output appears here —

About this tool

The Polybius Square Cipher Encoder / Decoder is a free, in-browser tool for one of the oldest coordinate ciphers, described by the Greek historian Polybius over two thousand years ago. The 25 letters of the alphabet are arranged in a 5×5 grid whose rows and columns are labelled 1–5. Each letter is then replaced by the two digits giving its row and column — for a standard square A is 11, B is 12, and so on. Because a 5×5 grid holds only 25 cells, two letters must share one: by default I and J are merged, with an option to merge C and K instead.

You can seed the square with a keyword: its unique letters are placed first, in order, and the remaining letters of the alphabet fill the rest of the grid. This changes every coordinate and produces a keyed Polybius square. The row and column labels default to 12345 but can be set to any five distinct characters. All computation runs locally in your browser, and the current square is drawn out so you can see exactly how each letter maps.

Encoding walks through your text, skips non-letters, and emits a row-then-column pair for each letter. Decoding strips everything except the label characters, groups them into pairs, and looks each pair up in the square. The Polybius square is the foundation of several later systems, including the tap code used by prisoners of war (where the coordinates are tapped out) and the ADFGX/ADFGVX field ciphers, making it a cornerstone of both cryptographic history and modern puzzle culture.

Frequently asked questions

How does the Polybius square encode a letter?
The alphabet is laid out in a 5×5 grid with rows and columns numbered 1–5, and each letter becomes the two digits of its row and column. In a plain square A is 11, B is 12, F is 21, and so on.
Why are two letters merged?
A 5×5 grid has only 25 cells but the alphabet has 26 letters, so two must share a cell. By tradition I and J are combined; this tool also offers merging C and K instead, selectable with the merge option.
What does the keyword do?
It reorders the square. The keyword's unique letters are placed first, then the rest of the alphabet fills the remaining cells, giving every letter new coordinates. Using a keyword produces a keyed Polybius square that is harder to read at a glance.
What is the connection to the tap code?
The tap code uses a Polybius square: each letter's row and column are tapped out as two groups of taps. It was famously used by prisoners of war to communicate through walls, and the same square underlies the ADFGX cipher.

More tools