BYTETOOLS

Polybius Square Cipher

Encode and decode with a Polybius square in 5×5 or 6×6 form, with an optional keyword, number or letter coordinates and the grid drawn out for you.

The 5 × 5 square

12345
1ABCDE
2FGHI/JK
3LMNOP
4QRSTU
5VWXYZ

Read the row label first, then the column label. I and J share a cell in the 5 × 5 square, so a decoded I could have been either letter.

0
Characters encoded
0
Coordinate pairs
5 × 5
Square

Encoded

How it works

  1. Lay the alphabet into the grid, keyword letters first if you supplied one.
  2. Replace each character with its row label followed by its column label.
  3. To decode, take the labels back two at a time and look the cell up.
  4. Because every character becomes two, a Polybius message is twice as long — that is what makes it useful as the first stage of the Nihilist and ADFGVX ciphers rather than as a cipher on its own.

Everything is computed locally in your browser — your text is never uploaded.

What is the Polybius Square Cipher?

The ByteTools Polybius Square Cipher tool replaces every character with its row and column coordinates in a grid.

  • 5×5 square with I/J merged, or 6×6 with letters and digits
  • Optional keyword seeding with duplicates removed automatically
  • Number (1–5 / 1–6) or letter (A–E / A–F) coordinate labels
  • The square drawn as a readable grid you can copy as text
  • Out-of-range and unpaired coordinates flagged rather than silently dropped
  • Choice of separator between pairs, all computed offline in your browser

How to use the Polybius Square Cipher

  1. 1

    Choose Encode or Decode, then pick a 5×5 or 6×6 square.

  2. 2

    Select number or letter coordinate labels and, for encoding, how the pairs should be separated.

  3. 3

    Add a keyword if you want a scrambled square, or leave it blank for the plain alphabet.

  4. 4

    Read the rendered grid to see exactly where each character sits.

  5. 5

    Type your text or paste your coordinate pairs and copy the result.

About the Polybius Square Cipher

The ByteTools Polybius Square Cipher tool replaces every character with its row and column coordinates in a grid. The classic 5×5 square folds J onto I so the twenty-five cells hold the whole alphabet; the 6×6 variant adds the digits 0 to 9 and keeps J separate, which is handy when your message contains numbers.

An optional keyword seeds the square: its letters go in first with duplicates dropped, then the rest of the alphabet follows in order. You can label the coordinates with numbers or with letters, and the grid is rendered on the page so you can read it off by hand. Decoding maps the pairs back to characters and clearly flags any coordinate that falls outside the square.

The cipher on its own is only a substitution — it doubles the message length without hiding much — but it is the first stage of the Nihilist and ADFGVX ciphers, and it is how tap codes work. Everything runs 100% locally in your browser and nothing you type is uploaded.

Frequently asked questions

How does the Polybius square cipher work?

You lay the alphabet into a grid and replace each letter with its row number followed by its column number. In the standard 5×5 square, H sits in row 2 column 3, so HELLO becomes 23 15 31 31 34.

Why do I and J share a square?

A 5×5 grid has only twenty-five cells but the alphabet has twenty-six letters, so one pair has to be combined. I and J were chosen because they were historically interchangeable and rarely cause confusion in context — pick the 6×6 square if you need them separate.

What does the keyword do?

It scrambles the square. The keyword's letters are written into the grid first, with repeats dropped, and the rest of the alphabet follows. Two people sharing the keyword build the same square, so it acts as the key.

Is the Polybius square a secure cipher?

No. It is a simple substitution with the coordinates written out, so letter-frequency analysis breaks it easily. Its real value is as a building block — the ADFGVX and Nihilist ciphers both start with a Polybius square before adding a transposition or an additive key.

Can I use a Polybius square for a tap code?

Yes, that is exactly what a tap code is. Prisoners tapped the row number, paused, then tapped the column number, using a 5×5 square with C standing in for K rather than I for J.

Related tools