Skip to content

Polybius square cipher

How it works

A Polybius square places twenty-five letters in a five-by-five grid. Every letter is identified by two digits: the row number first and the column number second. The top-left cell is 11, the cell beside it is 12, and the bottom-right cell is 55. Encoding replaces each letter with its coordinate pair; decoding finds the cell named by each pair.

The English alphabet has twenty-six letters, so one cell convention is required. The default merges I and J in the same position, with J normalized to I during encoding. The second option removes W, a convention used in parts of the French cryptographic tradition and by the Collon cipher. When W is removed, this tool reports W as invalid rather than guessing a replacement.

An optional keyword disorders the grid. The tool writes unique keyword letters first, discarding repeats, then appends the unused alphabet letters in order. Both sender and receiver need the same keyword, merge rule, and row-first coordinate convention. The current square is shown above the text fields so you can inspect every cell.

Coordinate spaces are optional when decoding because the tool collects valid digits in pairs. Encoding displays spaces between pairs for readability. The grid is also the foundation for fractionation ciphers: Bifid rearranges its coordinate digits, Collon replaces digits with edge letters, and ADFGVX expands the idea to a six-by-six mixed letter-and-number square.

Worked example

Encode HELLO with the standard alphabetical square and the default I/J merge. Read the row number and then the column number for each letter.

LetterRowColumnCoordinate
H2323
E1515
L3131
L3131
O3434
  1. Build the square: Fill a five-by-five grid alphabetically and place I/J in one shared position.
  2. Find each letter: Locate H, E, L, L, and O in the grid.
  3. Write row then column: Record 23, 15, 31, 31, and 34.
  4. Join the coordinates: The encoded message is 23 15 31 31 34.

Reading the pairs in order gives 23 15 31 31 34. To decode, split the digits back into pairs and look up each intersection: 23 is H, 15 is E, 31 is L, and 34 is O.

History and origin

The square is named for the Greek historian Polybius, who described a signaling system in the second century BCE. His method mapped letters into coordinate groups that could be communicated with separate sets of torches. The surviving account used the Greek alphabet and practical visual signaling rather than the modern English grid shown on this page.

Later cryptographers adapted the coordinate idea to written digits, checkerboards, telegraphy, field codes, and more elaborate ciphers. A plain square makes substitution easy to perform, while a keyed square changes the layout. Its greatest historical influence comes from descendants that transpose, add, or otherwise combine the coordinates.

How to break it

A plain Polybius square is not secure by modern standards. It is a monoalphabetic substitution: the same letter always produces the same pair. Pair frequencies therefore mirror ordinary letter frequencies, repeated words preserve repeated coordinate patterns, and only twenty-five cells are possible.

When the grid is alphabetical, the coordinates directly reveal nearby alphabet positions. A keyword hides that ordering but does not hide frequency or repetition. Analysts can treat each two-digit pair as a substitution symbol and apply frequency analysis, word-pattern matching, and likely-word guesses. If spaces are preserved, word lengths add even more clues.

Polybius coordinates remain valuable for teaching fractionation and for building puzzles, but they do not protect private information. Keyed descendants such as Bifid and ADFGVX add transposition, yet they too are historical systems with known attacks and should not replace modern encryption.

Frequently asked questions

How do I read a Polybius square?

Read the first digit as the row and the second as the column. Coordinate 23 points to row 2, column 3.

Why are I and J combined in a Polybius square?

A five-by-five grid has twenty-five cells but English has twenty-six letters. Combining I/J is the most common English convention.

Can a Polybius square remove W instead?

Yes. Select Drop W to use the twenty-five-letter convention found in the Collon cipher and some French sources.

What does a keyword do to the square?

Unique keyword letters fill the first cells, followed by unused alphabet letters. This creates a disordered grid that both parties must share.

What is HELLO in a Polybius square?

With the default alphabetical I/J grid, HELLO becomes 23 15 31 31 34.

Is a Polybius square secure?

No. It preserves monoalphabetic frequencies and repeated patterns. It is useful for history, education, and puzzles rather than confidential data.

Privacy note

All processing happens in your browser. Your text never leaves your device and is never transmitted to ToolPlex.