Three Cipher Variants
Supports the standard 5×5 numeric Polybius Square, the WWI-era ADFGX variant (letters A,D,F,G,X as labels), and ADFGVX — a 6×6 grid that encodes the full alphanumeric charset.
Encode and decode messages with the ancient Polybius Square cipher. Supports standard numeric, ADFGX and ADFGVX variants with custom keyword keys and live step-by-step grid visualization.
| 1 | 2 | 3 | 4 | 5 |
|---|
Enter text to encode or decode. Choose variant, set a keyword key, and see the step-by-step grid mapping.
Everything you need to explore the world's most famous square cipher.
Supports the standard 5×5 numeric Polybius Square, the WWI-era ADFGX variant (letters A,D,F,G,X as labels), and ADFGVX — a 6×6 grid that encodes the full alphanumeric charset.
Enter a keyword to shuffle the Polybius Square — unique letters from the keyword fill the grid first, then remaining alphabet letters in order. This makes your cipher unique and harder to crack without the key.
See every character mapped individually — the exact row and column coordinates highlighted live in the grid. Perfect for learning, teaching or manually verifying an encoded message.
Full bidirectional cipher — encode plaintext to numeric or letter codes, or paste a code string to decode back to readable text. Works instantly with real-time validation as you type.
Real-time error detection — warns if decode input contains invalid codes for the selected variant, spots malformed pairs, and highlights problematic characters before processing.
All encoding and decoding runs entirely in your browser. No text is sent to any server — ideal for encoding private messages, studying historical ciphers or building cipher-based educational exercises.
Four simple steps from letter to number and back.
Arrange the 25 letters (I/J combined) in a 5×5 grid. With a keyword, unique keyword letters fill the grid first, then the remaining alphabet letters follow in order.
Number the rows and columns 1–5 (standard), or use ADFGX or ADFGVX letters as labels depending on the variant selected.
For each letter in the plaintext, find its cell in the grid. Write the row label followed by the column label as its encoded pair — e.g. 'A' → '11'.
Concatenate all the two-character codes to form the ciphertext. Decode by reversing: split the ciphertext into pairs and look up each pair's row/column to recover the letter.
The Polybius cipher, invented by the ancient Greek historian Polybius around 150 BC, is one of the world's oldest systematic substitution ciphers. Rather than replacing each letter with another letter, Polybius encoded each character as a pair of coordinates — a row number and a column number — derived from a 5×5 square grid now known as the Polybius Square. This simple but clever system transformed letters into numbers, enabling messages to be transmitted as light or sound signals.
The Polybius Square algorithm arranges 25 letters of the alphabet (combining I and J into a single cell) into a grid labeled 1–5 on both axes. The letter A at row 1, column 1 encodes as 11; B at row 1, column 2 as 12; and so on. To decode, the process reverses: each pair of digits identifies a unique row and column, recovering the original letter.
The Polybius cipher's legacy reaches far beyond ancient Greece. During World War I, German military cryptographers developed the ADFGX cipher (and later ADFGVX), which used the letters A, D, F, G, X as grid labels instead of numbers — chosen because these letters are highly distinct in Morse code, reducing transmission errors. ADFGVX also extended the grid to 6×6 to accommodate digits 0–9 alongside letters.
Modern use cases for the Polybius cipher include cryptography education, CTF (Capture The Flag) competition puzzles, historical cipher studies, escape room design and steganographic art. Adding a keyword dramatically increases complexity — the keyword letters fill the grid first in unique-letter order, scrambling standard positions and making the cipher resistant to simple frequency analysis.
Best practices: always use a secret keyword key when encoding sensitive content; for real security combine Polybius with a transposition cipher (as in ADFGVX); and use this tool purely for educational exploration — Polybius is a classical cipher not suitable for modern cryptographic security.
Everything about the Polybius cipher, variants and use cases.
Explore our full suite of crypto tools, AI utilities and developer resources — all free, no sign-up required.
🍪 We use cookies to improve your experience. See our Cookie Policy.