Cabinet Noir>Learn / Polybius square cipher

Not sure which cipher? Identify it
Every letter of the message becomes the row and column numbers of its cell in a 5×5 grid.
Typesubstitution cipher
Breaking ittrivial to break
EraClassical Greece, 2nd century BC
NamePolybius' torch-signalling scheme, later the basis of tap code and fractionation
Modesencrypt · decrypt

Learn

Polybius square cipher

How the Polybius square works

The idea in one sentence

The Polybius square turns every letter into a pair of numbers — the row and column of a 5×5 grid — so a message becomes a stream of coordinates that says nothing without the grid.

The recipe

  1. Draw a 5×5 grid and fill it with the alphabet. There are only 24 letters after I and J share a cell, so both live in the same box.

  2. Number the rows and columns 1–5. Every letter now has an address: A is 11, B is 12, Z is 55.

  3. To encrypt, replace each letter with its pair: ATTACK becomes 11 44 44 11 13 25.

  4. To decrypt, split the digit stream into pairs and look each one up in the grid — the pair is the row and column of the letter.

A worked example

Step 1 of 12
Plaintext letter
Square coordinates
Fractionated so far
A
11
11

Each row follows one plaintext letter: which coordinates it becomes, and how the pair stream grows. Notice the shape: two digits per letter, nothing but the digits 1–5 — the whole fingerprint of this cipher.

The keyed square

Fill the grid with a Key first and the mapping changes completely. With the keyword SPARTAN, the square starts S P A R T A N… — the keyword's letters (deduplicated), then the rest of the alphabet in order.

Step 1 of 12
Plaintext letter
Square coordinates
Fractionated so far
A
13
13

The pairs now point to different letters than the plain square would — an attacker who assumes the plain grid decodes gibberish. The I/J shared cell survives: the square always holds 25 letters.

Why this is a substitution in disguise

Strip away the grid and nothing has moved: every plaintext letter maps to one fixed symbol, always. The coordinates are just an alphabet written as numbers — a Substitution, not a transposition. That is why the ciphertext keeps a substitution's fingerprints: the most frequent pair is the most frequent letter, E, wearing the number 15 of E's cell.

Try it in the tool

Polybius square: guides

Guide 1 — your first coordinates

  1. Open the tool, leave the square key empty and type HELLO. The output is 23 15 31 31 34 — five letters in, five pairs out.

  2. Watch the square under the controls: the highlighted cell jumps to the last letter of the output, with its row and column lit.

  3. Switch to decrypt mode and paste the pairs back — HELLO returns. The pairs are just addresses; the grid looks them up either way.

Guide 2 — the keyed square

  1. Type a square key, say SPARTAN, and encrypt the same HELLO. The output changes completely — same pairs in the plain square, new letters in the keyed one.

  2. Clear the key and compare the two outputs pair by pair: only the letters that moved inside the grid changed their numbers.

  3. Notice the square keeps exactly 25 letters whatever you type — duplicates in the key are skipped, and I/J still share a cell.

Guide 3 — reading by hand

  1. Encrypt MEET AT NOON with no key and write the pairs on paper in rows of five pairs.

  2. Cover the grid and try to read the message from the pairs alone — you will find yourself reconstructing the grid from memory, which is exactly the lookup table the cipher forces everyone to share.

  3. Try the practice challenges: the decode exercises use the plain square, and the hardest one uses a keyed square — its keyword travels in the hints.

Breaking the Polybius square

There is no cracker tab for this cipher — and that is not an oversight, it is the lesson.

Try it in the tool

The square is a substitution wearing a grid

Every plaintext letter maps to one fixed symbol, always: E is always 15 of the plain square, whatever comes before or after it. Strip the pairs back to letters and you are holding an ordinary Substitution — the very cipher whose guided breaking the Keyword page teaches.

The way in: the frequency of pairs

  1. Count the pairs in the ciphertext. With the plain square, the most frequent pair is E (15), then T (44), A (11), O (34) — the usual English order wearing numbers.

  2. Assign candidate letters to the frequent pairs, exactly like the Frequency analysis step of the keyword cracker.

  3. When the square is keyed, the assignment is the square: recover enough letters and the grid fills itself in — then the keyword reveals itself the way it does in the keyword cracker.

Try it in the app

Take a keyed-square Polybius ciphertext, paste it into the Keyword substitution cracker after rewriting each pair as its plain-square letter (or as any fixed placeholder), and the assignment board does the rest. The coordinates change the costume, not the weaknesses: a monoalphabetic cipher is a monoalphabetic cipher, whether its symbols are letters or numbers.

Where the square gets dangerous

On its own the square is trivial. Chained into fractionation and transposition — ADFGVX — or given a periodic numeric key — the Nihilist cipher — the same 25 cells become the substrate of far tougher systems. That is why this page exists: to teach the coordinate idea once, cleanly, before the heavier ciphers borrow it.

Glossary

Plaintext — The original readable message before encryption.
Ciphertext — The scrambled message produced by encryption.
Key — The secret that controls how the text is scrambled.
Alphabet — The set of letters the cipher works with.
Polybius square — A grid that turns each character into two coordinates: the row and the column of its cell.
Substitution — Replacing each letter with another one.