Encode with the standard square
Hello
23 15 31 31 34
H is in row 2, column 3, so it becomes 23.
Turn each letter into its row and column in a 5×5 grid, and coordinates back into letters. Use the standard square or build one from a keyword, shown live as you type.
Square
Hello
23 15 31 31 34
H is in row 2, column 3, so it becomes 23.
44 23 11 33 25 43
THANKS
44 = row 4, column 4 = T.
Hello
24 12 32 32 35
The keyword moves D, E and V to the front of the square, so every coordinate changes.
The Polybius square places the alphabet in a 5×5 grid and replaces each letter with two numbers: its row and its column. It is named after the Greek historian Polybius, who described a similar grid around 150 BC for signalling with torches: one set of torches for the row, another for the column. Because the alphabet has 26 letters and the grid has 25 cells, I and J usually share a cell.
1 2 3 4 51 A B C D E2 F G H I K3 L M N O P4 Q R S T U5 V W X Y ZRead the row first, then the column: H is in row 2, column 3, so it becomes 23. HELLO becomes 23 15 31 31 34.
To make the square less predictable, write a keyword first (skipping repeated letters) and then the rest of the alphabet, just like the Playfair cipher does. With the key DEV, the first row becomes D E V A B, and every coordinate changes.
The Polybius square is not secure on its own. Each letter always gets the same pair of digits, so frequency analysis breaks it like any simple substitution cipher.
const SQUARE = 'ABCDEFGHIKLMNOPQRSTUVWXYZ'; // no J const encode = (text) => [...text.toUpperCase().replace(/J/g, 'I').replace(/[^A-Z]/g, '')] .map((c) => { const i = SQUARE.indexOf(c); return `${Math.floor(i / 5) + 1}${(i % 5) + 1}`; }) .join(' '); encode('Hello'); // "23 15 31 31 34"Decoding gives the wrong letters
The message may use a keyword square, or read column first instead of row first. Try swapping the two digits of a pair, or ask for the keyword.
Some pairs decode as ?
Each digit must be between 1 and 5. A 0, 6 or higher digit means a typo, or a different grid size such as 6×6 (which adds the digits 0–9).
The decoded text has I where J was
I and J share a cell in a 5×5 square, so J always decodes as I. Read it from context.
Choose Decode and paste the digit pairs. The first digit is the row and the second the column of the letter in the grid.
A 5×5 square has 25 cells for 26 letters, so two letters must share. I and J is the usual choice because they look and sound alike.
Tap code is a Polybius square sent by tapping: first the row, then the column. Tap code merges K into C instead of J into I.
No. Everything runs in your browser.
Free, private developer tools that run in your browser. No signup, nothing uploaded, no waiting.
Tip: press Ctrl D to bookmark dev247.