Polybius Square Cipher

Encode and decode messages with the Polybius square cipher.

How it is calculated

The 5×5 grid holds the alphabet row by row with I and J sharing one cell: row 1 is A B C D E, row 2 F G H I/J K, row 3 L M N O P, row 4 Q R S T U, row 5 V W X Y Z. To encode, each letter is replaced by its row and column digits (both from 1 to 5), and the pairs are separated by spaces. J is treated as I. Anything that is not an A–Z letter (spaces, digits, punctuation, accented letters) is skipped. To decode, every two consecutive digits are read as row and column; pairs containing a digit outside 1–5 are ignored. Decoding returns capital letters, so J cannot be recovered.

Worked example

Encode HELLO. H is in row 2, column 3, giving 23. E is row 1, column 5, giving 15. L is row 3, column 1, giving 31 (twice). O is row 3, column 4, giving 34. Result: 23 15 31 31 34.

Try this example →

Common mistakes

  • Expecting the letter J to survive; it is encoded as I, so decoding gives I.
  • Using the cipher for real security; it is a simple substitution and is broken at a glance with letter frequencies.
  • Typing digits or accented characters in encode mode and expecting them in the output; they are dropped.
  • Decoding with the mode left on encode, or entering digit pairs that include 0, 6, 7, 8 or 9.
  • Reading the pair as column then row; the first digit is the row.

About this calculator

This calculator encrypts or decrypts text with the Polybius square, a classical cipher dating to ancient Greece that arranges the alphabet in a 5×5 grid (I and J typically share a cell) so each letter can be represented by its row and column digits.

Cryptography students and puzzle enthusiasts use it to learn the fundamentals of substitution ciphers and coordinate-based encoding — the same principle later used in more advanced ciphers, like the Polybius-based ADFGVX cipher from World War I.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    This is a classic puzzle cipher, not real security, since every letter always maps to the same pair of digits. The 5 by 5 grid has no J, so J is encoded as I and cannot be told apart on decoding. Anything that is not a letter, including digits, accents and punctuation, is skipped while encoding, so Turkish letters such as ş or ı will be left out. Planning a puzzle or a game? Tell us which alphabet you would want supported.

Popular calculators

All Calculators