🔢 Polybius Square Cipher
Encrypt and decrypt text with the Polybius square cipher. Map letters to two-digit coordinates in a 5x5 grid (I and J share a cell).
About the Polybius Square Cipher
The Polybius square (or Polybius checkerboard), attributed to the ancient Greek historian Polybius around 150 BC, is one of the earliest known ciphers. Each letter is represented by its row and column coordinates in a 5x5 grid. Because the grid holds only 25 cells, the letters I and J share a single cell. This tool runs entirely in your browser — nothing is uploaded.
How it works
- Build the grid — A standard grid fills A–Z (with I/J combined) left to right, top to bottom. An optional key rearranges the letters.
- Encrypt — Each letter becomes two digits: the row number (1–5) followed by the column number (1–5). For example, in the standard grid A becomes 11, B becomes 12, and Z becomes 55.
- Decrypt — Read the input two digits at a time, look up the row and column, and emit the matching letter.
- Non-letter characters are skipped during encryption; non-digit characters are skipped during decryption.
Use cases
- Studying one of the oldest documented ciphers.
- Encoding messages as numbers for telegraph or tap-code style transmission.
- Building puzzles where text is hidden in a numeric stream.
- Understanding the foundation that later ciphers (ADFGVX, Bifid, Nihilist) build upon.
Frequently asked questions
Why do I and J share a cell? A 5x5 grid has only 25 cells but the English alphabet has 26 letters, so I and J are merged. Decrypting that cell cannot tell them apart without context.
Is the Polybius square secure? No. It is a simple monoalphabetic substitution and is easily broken, especially since the digit pairs directly reveal the grid.
What does the optional key do? The key scrambles the letter order in the grid (key first, then remaining letters), making the mapping harder to guess without changing the algorithm.
Does this tool upload my text? No. All encryption and decryption happens locally in your browser.