Playfair Cipher Tool

Encrypt or decrypt text with the Playfair cipher, a classic letter-pair substitution that uses a 5 by 5 key square built from a keyword. The output updates as you type.

1 Paste your text and pick the options

2 Your answer

Your answer shows here as you type.

How to use the Playfair Cipher Tool

  1. Type the message in the Text box. Spaces and punctuation are ignored, and J is treated as I.
  2. Enter a keyword in the Key box. Letters repeated in the keyword are dropped.
  3. Choose Encrypt or Decrypt. The key square and the result update as you type.

Frequently asked questions

What is the Playfair cipher?

It is a digraph substitution cipher invented by Charles Wheatstone in 1854 and named after Lord Playfair, who promoted it. It encrypts pairs of letters using a 5 by 5 key square built from a keyword.

Why is J replaced with I?

The key square has 25 cells, so the 26-letter alphabet is squeezed in by merging J into I. This is the usual convention.

How are double letters and an odd length handled?

When both letters of a pair are the same, an X is inserted between them, or a Q if the pair is XX. If the message has an odd number of letters, an X is added at the end.

Is the Playfair cipher secure?

No. It hides single-letter frequencies but leaves digraph patterns, so it can be broken with enough ciphertext. It is useful for learning and puzzles, not for protecting real data.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.