Skip to content
Test versionSearch

Text and writing

Playfair puzzle cipher

Encode or decode messages with the Playfair cipher: build a 5×5 key square from a keyword and process letter pairs, with fillers left visible.

How it worksFAQRelated tools

Content reviewed:

Also available for Germany, in German 

A–Z and spaces. Plaintext up to 200 characters, ciphertext up to 400; key 1–40. Merge I/J. Filler X, or Q beside X. Decryption keeps fillers.

Educational puzzles only; not modern encryption. Letter case, spaces and I/J cannot be reconstructed. The own Q-beside-X rule is explicitly chosen.

Decimal results are approximate. Inputs stay in this browser tab.

Sources

How it works

Educational puzzles only; not modern encryption. Letter case, spaces and I/J cannot be reconstructed. The own Q-beside-X rule is explicitly chosen.

Worked example

Choose Encode, enter AB as the text and A as the keyword. Result: BC.

About this calculation

The Playfair puzzle cipher builds a 5×5 key square from your keyword and uses it to encode a message in letter pairs, or to decode a Playfair ciphertext. It is meant for educational puzzles and is not modern encryption. The method follows the Playfair arithmetic described by Yale.

The text may contain the letters A to Z and spaces. Plaintext can be up to 200 characters, ciphertext up to 400, and the keyword 1 to 40 characters. I and J share one cell of the square. X serves as the filler letter, and Q takes its place when the filler would sit beside an X.

When decoding, the fillers stay visible in the result. Letter case, spaces and the difference between I and J cannot be reconstructed. With AB as the text and A as the keyword, the encoded result is BC. Results can be downloaded as JSON, TXT or printable HTML, which also contain the entered key.

Worked example

With these example values the calculator gives the result below. You can change any value in the form above.

Inputs

Direction
Encode
Text
BALLOON
Keyword
DEMO

Result

Result
HDSMNMGT
Prepared pairs
BALXLOON
Inserted fillers
1
Key-square row 1
D E M O A
Key-square row 2
B C F G H
Key-square row 3
I K L N P
Key-square row 4
Q R S T U
Key-square row 5
V W X Y Z

Frequently asked questions

How does the Playfair cipher work?

The Playfair cipher builds a 5×5 key square from a keyword and then encodes the message in letter pairs. I and J share one cell, and a filler letter separates problem pairs. The page cites Yale on Playfair arithmetic.

How do I encode a message with the Playfair cipher?

Choose Encode, enter the text and a keyword of 1 to 40 letters. With AB as the text and A as the keyword, the Playfair puzzle cipher returns BC.

How do I decode a Playfair cipher?

Choose Decode, enter the ciphertext of up to 400 characters and the same keyword. The fillers inserted during encoding stay visible in the decoded text.

What filler letter does the Playfair cipher use?

The filler is X. When the filler would stand beside an X, Q is used instead, a rule that is explicitly chosen in this Playfair puzzle cipher.

Is the Playfair cipher secure?

No. The Playfair puzzle cipher is for educational puzzles only and is not modern encryption.