EN
My tools

Playfair Cipher — Encrypt & Decrypt with Key Square

Encrypt and decrypt the Playfair cipher from a keyword: see the 5×5 key square, each digraph and the rule used. I/J merged or Q omitted, custom filler letter.

Splits double letters and pads an odd last letter.
Ciphertext
BM OD ZB XD NA BE KU DM UI XM MO UV IF
Key square
PLAYF / IREXM / BCDGH / KNOQS / TUVWZ
Digraphs
13

1 filler letter was added to split double letters or pad the end.

Key square
12345
1PLAYF
2IREXM
3BCDGH
4KNOQS
5TUVWZ
Digraphs
Plaintext pairRuleResult
HIrectangle: swap columnsBM
DEsame column: letter belowOD
THrectangle: swap columnsZB
EGrectangle: swap columnsXD
OLrectangle: swap columnsNA
DIrectangle: swap columnsBE
NTrectangle: swap columnsKU
HErectangle: swap columnsDM
TRrectangle: swap columnsUI
EXsame row: letter to the rightXM
ESrectangle: swap columnsMO
TUsame row: letter to the rightUV
MPrectangle: swap columnsIF
My tools →
Advertisement

The Playfair cipher, invented by Charles Wheatstone in 1854 and promoted by Lord Playfair, encrypts pairs of letters instead of single letters, which hides the letter frequencies that break simple substitution ciphers. It was used in the field by British forces into the early 20th century. This tool builds the 5×5 key square from your keyword, encrypts or decrypts, and shows every digraph with the rule that was applied.

How to use this tool

  1. Choose encrypt or decrypt and paste the text.
  2. Type the keyword; repeated letters are used once.
  3. Pick the square type (I/J together is the usual one) and the filler letter.
  4. Read the result and the digraph table; when decrypting, check the "without fillers" guess.

Formula

Same row → each letter is replaced by the one to its right. Same column → the one below. Otherwise → the letter in the same row but in the other letter’s column.

Before encrypting, the text is split into pairs; a double letter such as EE is split with the filler (E X E…), and an odd final letter is padded. Decryption moves left and up instead. Rows and columns wrap around. The key square is the keyword without repeats, followed by the rest of the alphabet.

Example

With the keyword PLAYFAIR EXAMPLE the square is PLAYF / IREXM / BCDGH / KNOQS / TUVWZ. "Hide the gold in the tree stump" becomes the pairs HI DE TH EG OL DI NT HE TR EX ES TU MP (the double E of "tree" is split with X) and encrypts to BMODZBXDNABEKUDMUIXMMOUVIF.

Frequently asked questions

Why does the decrypted text contain extra X letters?

They are fillers added when encrypting, to split double letters and to make the length even. The "without fillers" line removes an X between two equal letters and at the end, but a genuine X in the message may also be removed, so read it in context.

What happens to J?

The 5×5 square holds only 25 letters, so I and J share a cell and J is written as I. Some variants drop Q instead; pick that option if your puzzle uses it.

Is Playfair secure?

No. It resists simple frequency counting, but digraph frequencies and known plaintext break it quickly, and computer hill-climbing solves it in seconds. Use it for puzzles and history, not secrets.

Last updated:

Cite or embed this tool
APA

kakaoCalc. (2026, November 8). Playfair Cipher — Encrypt & Decrypt with Key Square. https://kakao.mobile/tools/playfair-cipher-tool/

MLA

“Playfair Cipher — Encrypt & Decrypt with Key Square.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/playfair-cipher-tool/.

Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms

Advertisement