Polybius Square Cipher Encoder

Encode each letter as a row and column coordinate pair.

Free Polybius square tool that encodes letters into row/column number pairs on a 5×5 grid (A=11, Z=55) and decodes them back. I and J share a cell, and it all runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How does the Polybius square work?

Letters are placed in a 5×5 grid filled A to Z with I and J sharing one cell. Each letter is replaced by its row and column number, so A=11 and Z=55.

The Polybius square is an ancient device that turns each letter into a pair of numbers based on its position in a 5×5 grid. Described by the Greek historian Polybius over two thousand years ago, it later became the foundation for more advanced fractionating ciphers. This tool encodes text into coordinate pairs and decodes them back, entirely in your browser.

How it works

Fill a 5×5 grid with the alphabet A to Z, merging I and J into one cell so that 25 letters fit exactly. Each letter is then represented by two digits: the first is its row number (1–5) and the second is its column number (1–5). So A sits at row 1, column 1 and becomes 11, while Z sits at row 5, column 5 and becomes 55.

Decoding reverses the process: every pair of digits is read as a row and column and mapped back to the letter at that cell. Because I and J share a cell, a decoded I may need to be interpreted as a J from context.

The standard 5×5 grid

  1   2   3   4   5
1 A   B   C   D   E
2 F   G   H  I/J  K
3 L   M   N   O   P
4 Q   R   S   T   U
5 V   W   X   Y   Z

Row 1, column 1 is 11; row 2, column 4 holds both I and J and encodes to 24; row 5, column 5 is Z at 55.

Worked example

Encode the word GERA:

  • G is at row 2, column 2 → 22
  • E is at row 1, column 5 → 15
  • R is at row 4, column 2 → 42
  • A is at row 1, column 1 → 11

So GERA becomes 22 15 42 11, and decoding those pairs returns the original letters.

Historical context and cipher descendants

The Polybius square dates to ancient Greece, where it was used to signal messages between fire beacons — each letter could be transmitted as two separate numeric signals rather than requiring a code for every possible letter. This made long-distance signalling practical with a small set of torches.

In the 20th century, the Polybius square was incorporated into several important field ciphers:

  • Bifid: converts each letter to a row/column pair, interleaves the rows and columns separately, then reads off new pairs. This fractionation means that each output letter depends on two input letters, which defeats simple frequency analysis.
  • Trifid: a three-dimensional extension (similar to the 3D cube on this site) that interleaves across three coordinate streams.
  • ADFGVX: used by German forces in World War I, substitutes the digits 1–5 with the letters A, D, F, G, V, X, then applies a transposition. The non-standard column headers were chosen because they are easy to distinguish by Morse code, reducing transmission errors.

On its own the Polybius square is a simple substitution — letter frequencies survive intact and it is broken trivially. Its lasting importance is as the first example of fractionation, the idea of splitting a symbol into parts that can then be shuffled independently.