Tools
English

Neogie Playfair · Word games

Playfair Cipher: Encode and Decode

Enter a keyword: the square is drawn and the message is encrypted two letters at a time.

Settings

Everything happens in your browser: nothing you type is sent.

The Playfair square

A five by five square is filled with the letters of a keyword, without repeating them, then with the rest of the alphabet. There are only 25 cells: I and J share one.

The rule for pairs

The message is cut into pairs. A doubled letter within a pair is split by an X, and a lonely last letter is completed. If both letters are on the same row, each takes its right-hand neighbour. In the same column, the one below. Otherwise they swap columns.

With the key “playfair example”, “Hide the gold in the tree stump” becomes BM OD ZB XD NA BE KU DM UI XM MO UV IF. To decrypt, the same rules are applied backwards.

A bit of history

Devised by Charles Wheatstone in 1854, the cipher bears the name of his friend Lord Playfair, who championed it. Armies used it because it can be worked by hand.

Its limits

Digits, accents and punctuation vanish, and today it is easily broken. To protect information, use AES.

Frequently asked questions

Why do X letters appear?

They split doubled letters and complete the last pair. Decryption cannot tell which ones were in the original.

What happens to J?

It is treated as an I.

Why is my message rejected?

An encrypted message has an even number of letters, no digits or signs, and no pair of identical letters.

Is my key saved?

No. It stays in the page and is neither sent nor kept.

How do I decrypt by hand?

Rebuild the square with the keyword, cut the message into pairs, then apply the rules backwards: on the same row take the letter to the left; in the same column the one above; otherwise the corners of the rectangle, as when encrypting.

Similar tools

Neogie BrailleBraille Translator: Text to Braille and BackType text to see it in braille, or paste braille signs to read them. Neogie A1Z26Letters to Numbers Converter (A=1, Z=26)Type words to get numbers, or paste numbers to read the words. Neogie SemaphoreSemaphore Flag Alphabet: Encode and DecodeType a message to see the flag positions, or tap the drawings to read it. Neogie AffineAffine Cipher: Encode and Decode OnlineChoose a and b, or paste an unknown message: the most likely keys are suggested. Neogie BaconBacon's Cipher: Encode and Decode (A and B)Five signs per letter: write a message or paste A and B groups to read it. Neogie CaesarCaesar Cipher: Encode and Decode OnlinePick a shift, or paste an unknown message and read all 25 attempts, ranked from the most to the least likely. Neogie VigenereVigenère Cipher: Encode, Decode and Find the KeyWith the key, the message reads at once; without it, the tool suggests the most likely keys. Neogie SubstitutionSubstitution Cipher and Frequency AnalysisEncrypt with your own alphabet, or rebuild the alphabet of an unknown message letter by letter. Neogie TranspositionRail Fence and Scytale Transposition CipherThe letters do not change, they change places: pick the method and the key. Neogie AtbashAtbash Cipher: the Reversed Alphabet OnlinePaste your text on either side: the same operation encodes and decodes. Neogie MorseMorse Code Translator with SoundType a message to see and hear it in Morse, or paste dots and dashes to read them. Neogie PigpenPigpen (Masonic) Cipher: Encode and DecodeType a message to draw it in symbols, or tap the symbols to decipher it. Neogie SyllablesOnline syllable counter: poems, haiku, textsType or paste a text: syllables are counted as you go, line by line and word by word. Neogie RhymesRhyming Dictionary: Find Words That RhymeType a word and see the words that rhyme with it, for a poem, a song or a game. Neogie AnagramAnagram generator: all the words from a set of lettersType some letters: all the words you can form with them, from longest to shortest. Neogie IdentifyCipher Identifier: Which Code Is This?A mysterious message? Paste it: leads are listed from the most to the least likely. Neogie TilesBest words from letter tiles, with pointsEnter the letters on your rack: the possible words, ranked from most to least profitable. Neogie ROT13ROT13 and ROT47: Encode and Decode OnlineThe same operation encodes and decodes: paste your text on either side. Neogie GuessWord of the Day Solver: right and wrong letter positionsEnter your guesses and their colours: the tool keeps only the words that are still possible. Neogie CrosswordCrossword and arrow puzzle solver by known lettersType the letters you have and one question mark per empty cell: the matching words appear.