decoder.tools

Playfair Cipher Decoder

Decrypt Playfair digraph ciphers from a keyword-built 5×5 matrix.

INPUT
OUTPUT

The result appears here as you type.

Decoding runs in your browser. What you paste is not sent to a server.

The Playfair cipher encrypts pairs of letters using a 5×5 grid built from a keyword, applying row, column or rectangle rules to each digraph — making it the first practical cipher to encrypt two letters at a time.

Example

Input
BMODZBXDNABEKUDMUIXMMOUVIF
Output
HIDETHEGOLDINTHETREXESTUMP
Digraphs: 13

Read it as "hide the gold in the tree stump" — Playfair inserts an X between the doubled letters of "tree", which you drop when reading. The decoder also shows the 5×5 key square built from the keyword.

What is the Playfair Cipher Decoder?

Invented by Charles Wheatstone in 1854 and promoted by Lord Playfair, this cipher was used in the field through both world wars because it needs nothing but a memorised keyword and a pencil. The keyword fills a 5×5 grid, followed by the remaining letters of the alphabet with I and J sharing a cell (25 cells, 26 letters).

Encryption works on digraphs. If both letters share a row, each is replaced by the letter to its right; if they share a column, by the letter below; otherwise they form a rectangle and each is replaced by the letter in its own row at the other letter's column. Doubled letters are split with a filler X, and an odd-length message is padded.

Encrypting letter pairs rather than single letters defeats simple frequency analysis, but Playfair still leaks: digraph frequencies survive, and roughly 600 characters of ciphertext are enough for a determined analyst.

How to use the Playfair Cipher Decoder

  1. Enter the keyword used to build the 5×5 grid.
  2. Paste the ciphertext — it should have an even number of letters.
  3. Read the plaintext, mentally removing the X fillers between doubled letters.

When to use it

  • Solving a Playfair challenge in a cryptography course or CTF.
  • Decrypting historical military correspondence for research.
  • Demonstrating how digraph encryption flattens single-letter frequencies.

Playfair Cipher Decoder at a glance

Invented1854 by Charles Wheatstone
Grid5×5 from a keyword; I and J share a cell
UnitDigraphs — two letters at a time
FillerX splits doubled letters and pads odd lengths

Frequently asked questions

Why do I and J share a square?

The alphabet has 26 letters and the grid has 25 cells. I and J are merged because they are rarely confused in context — decoded text may show I where a J belongs, and you restore it by reading.

What are the X characters in my plaintext?

Fillers. Playfair cannot encrypt a doubled letter within one digraph, so an X is inserted between them, and another is appended if the message length is odd.

Is Playfair secure?

Not by modern standards. Encrypting digraphs defeats single-letter frequency analysis, but digraph frequency analysis breaks it with a few hundred characters of ciphertext.

Last reviewed · found a mistake? contact@decoder.tools · view as markdown