Polybius Square Cipher
Encode letters as row/column coordinates in a 5×5 grid.
Encoded
Polybius Square (I and J share position 24)
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | A | B | C | D | E |
| 2 | F | G | H | I | K |
| 3 | L | M | N | O | P |
| 4 | Q | R | S | T | U |
| 5 | V | W | X | Y | Z |
How the Polybius Square Works
The Polybius square is a 5×5 grid containing the alphabet (I and J share one cell). Each letter is encoded as its row number followed by its column number — so A = 11, B = 12, Z = 55. To decode, split the digits into pairs and look up the row/column. It is one of the building blocks of more complex ciphers like the ADFGVX cipher used in WWI.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Working through a classical cipher exercise based on a coordinate grid.
- Solving a puzzle whose ciphertext is pairs of digits.
- Demonstrating how a substitution can double the message length.
- Reproducing a historical cipher for a talk or a lesson.
- Producing a numeric ciphertext for a treasure hunt.
Frequently Asked Questions
- How does the Polybius square work?
- Each letter is located in a 5×5 grid and replaced by its row and column numbers, so A becomes 11 and Z becomes 55. It is a substitution cipher whose output is digits, which is what made it useful for signalling by torches, knocks or taps.
- Why do I and J share a cell?
- Because the alphabet has 26 letters and a 5×5 grid has 25 cells. Merging I and J is the traditional resolution — they were interchangeable in Latin — so decoding always produces I and the reader restores J from context. Some variants merge C and K instead.
- What is the tap code?
- The same square signalled as knocks: one group of taps for the row, a pause, then the column. It was used by prisoners of war in Vietnam to communicate through cell walls, and its variant drops the K rather than the J.
- Is it secure?
- No. It is a simple substitution, so letter frequencies survive intact in the digit pairs and a frequency count breaks it quickly. Its historical value was as a signalling encoding — reducing an alphabet to two symbols out of five — rather than as protection.
- What is it used for today?
- As a building block. The Nihilist and ADFGVX ciphers both start with a Polybius square and then add transposition or a key, which is what turns a trivially breakable substitution into something that required real effort in its era.
Common errors and gotchas
- Forgetting that I and J share a cell, so the plaintext needs a human to disambiguate.
- Reading the coordinates in the wrong order, which produces a different letter entirely.
- Expecting punctuation and digits to encode, when the grid holds twenty-five letters.
- Assuming the grid is standard, when a keyword can reorder it completely.
- Treating it as secure, since it is a simple substitution once the grid is known.
Related Encoders & Decoders tools
Base64 Encoder
Encode or decode Base64 strings.
URL Encoder
Safely encode or decode URL parameters.
Base Converter
Convert numbers between binary, octal, decimal, hex, and base 2-36.
ROT13 Encoder / Decoder
Apply the reversible ROT13 letter-substitution cipher.
HTML Entity Encoder / Decoder
Escape or unescape HTML entities like & and <.
Punycode Converter
Convert internationalized domains to and from Punycode.
Text to Morse Code
Translate text into Morse code dots and dashes.
Morse Code to Text
Decode Morse code dots and dashes back into text.