Polybius Square Cipher

Encode text to coordinate pairs using the classic 5x5 Polybius grid (I/J combined).

12345
Plaintext
Encoded
Enter text above to encode using the Polybius square.

How to Use the Polybius Square Tool

  1. Choose Encode or Decode — select your direction using the option chips above.
  2. Optional: set a keyword — click Custom Key to enter a keyword that shuffles the grid order.
  3. Type or paste your text — plaintext for encoding, number pairs for decoding.
  4. Read the output — encoded pairs or decoded text appears on the right.
  5. Copy the result — use the Copy button to copy to clipboard.

About the Polybius Square

The Polybius square is one of the oldest known ciphers, developed by the ancient Greek historian and soldier Polybius (c. 200–118 BC). Originally designed to allow messages to be signaled with torches (by holding up groups of torches to indicate row and column numbers), it later became the basis for many more advanced cipher techniques. The square's 5x5 grid holds 25 of the 26 English letters, with I and J traditionally sharing one cell.

Standard vs. Keyed Polybius Square

In the standard Polybius square, the alphabet is placed in the grid left-to-right, top-to-bottom in order: ABCDE in row 1, FGHIJ in row 2, and so on. In a keyed version, a keyword is written first (with duplicate letters removed), followed by the remaining unused letters of the alphabet. This means the same plaintext will produce completely different ciphertext depending on the keyword, greatly increasing the cipher's security.

Encoding Rules

Each letter maps to two digits: the first is its row number (1–5) and the second is its column number (1–5). Since I and J share cell (2,4) = "24", encoding always treats J as I, and decoding 24 gives I. Spaces and punctuation in the plaintext are typically skipped during encoding. In the output, pairs are separated by spaces for readability.

Historical Uses and Derivatives

The Polybius square is the foundation for several more advanced cipher systems. The ADFGVX cipher used in WWI replaced the digits 1–5 with the letters A, D, F, G, X (and V for the 6x6 version) and then added a columnar transposition step. The Tap Code, used by American POWs in Vietnam, is a direct application of the Polybius square: K is merged with C, and each letter is communicated as two sequences of taps representing the row and column. The Bifid cipher extends the Polybius square into a more complex fractionating scheme.

Security Analysis

The standard Polybius square offers no real security — it is a simple monoalphabetic substitution where each letter is replaced by a fixed two-digit pair. Frequency analysis can crack it easily. A keyed Polybius square is slightly harder but still vulnerable to frequency analysis since it remains a monoalphabetic substitution. The value of the Polybius square lies not in standalone security but as a building block for more sophisticated ciphers that combine substitution with transposition.

Frequently Asked Questions

The Polybius square is a cipher invented by the ancient Greek historian Polybius. It uses a 5x5 grid where each letter is encoded as its row and column numbers. A=11, B=12, etc. It's one of the earliest known cipher systems.
The 26-letter English alphabet doesn't fit in a 5x5 grid (25 cells). I and J are combined because they're phonetically similar and context usually clarifies which is meant during decoding.
A keyword Polybius square places the keyword letters (deduplicated) first in the grid, then remaining alphabet letters. This shuffles the encoding, making frequency analysis harder.
Switch to Decode mode and paste your number pairs. Each pair of digits represents a row and column in the grid. The tool automatically looks up the corresponding letter.
The Tap Code (used by POWs) is a direct application of the Polybius square with C used instead of K. Letters are tapped as row count then column count, separated by a pause.