Free online Playfair cipher tool with interactive 5x5 matrix visualization. Encrypt and decrypt digraph-based messages with automatic key square generation.
Not sure which cipher you have? Use the Cipher Identifier to auto-detect cipher types from unknown ciphertext using frequency analysis and Index of Coincidence.
Playfair is a manual digraph (pair-of-letters) substitution cipher built around a 5×5 key square. Instead of substituting one letter at a time like Caesar or Atbash, it encrypts pairs of letters using their positions in the square, which flattens the single-letter frequency distribution and makes the cipher far harder to break than any monoalphabetic substitution.
Pick a keyword (for example, "MONARCHY") and fill a 5×5 grid with the keyword letters first (skipping duplicates), then the rest of the alphabet in order. I and J share a cell:
| M | O | N | A | R | | C | H | Y | B | D | | E | F | G | I/J | K | | L | P | Q | S | T | | U | V | W | X | Z |
Split the plaintext into pairs. If a pair would contain the same letter twice (e.g., "LL" in "HELLO"), insert an X. If the plaintext has odd length, pad with X. Replace J with I.
"HELLO" → HE LX LO
"HE LX LO" with the MONARCHY square:
Ciphertext: "CFSUPM". Decryption uses the same key square with row/column moves reversed.
Playfair was invented in 1854 by Charles Wheatstone, a British physicist (also known for the Wheatstone bridge). It was named after his friend Lord Lyon Playfair, who promoted its adoption by the British government. British forces used it for tactical field communications in the Second Boer War, World War I, and the early part of World War II — attractive because it required only a memorized keyword and a pencil, yet was substantially stronger than any monoalphabetic cipher.
Educational and recreational only — CTF challenges, puzzle hunts, cryptography courses (it bridges monoalphabetic ciphers and polyalphabetic ones like Vigenère), and WWI/WWII reenactment. Do not use it where real confidentiality matters.
Playfair is dramatically stronger than monoalphabetic substitution but is still broken by standard hand cryptanalysis:
The Index of Coincidence for Playfair ciphertext sits near 0.046–0.052, between monoalphabetic (~0.067) and polyalphabetic (~0.038) — itself a diagnostic.
If you have unknown ciphertext and want to test whether it might be Playfair, the Cipher Identifier flags the characteristic digraph-frequency profile.