About this tool
The Playfair Cipher tool encrypts and decrypts text with Charles Wheatstone's 1854 digraph cipher, the first practical cipher to encrypt pairs of letters instead of single letters. It works from a 5x5 key square built from a keyword: the keyword's unique letters are written first (I and J share one cell), then the rest of the alphabet fills the remaining squares. This tool shows the generated square so you can follow every step.
To encrypt, the plaintext is upper-cased, J is replaced with I, and the letters are split into digraphs (pairs). A filler letter (X by default) is inserted between a doubled pair and appended if the text has an odd length. Each digraph is then transformed by three rules: two letters in the same row are each replaced by the letter to their right (wrapping around); two in the same column by the letter below (wrapping); and any other pair forms a rectangle, where each letter is replaced by the one in its own row but the other letter's column. Decoding applies the same rules in reverse (left / up / same rectangle).
Everything runs locally in your browser with nothing uploaded, so your messages stay private. Note that Playfair merges I/J and pads with a filler, so decoded text may contain stray X's or an I where a J belonged — these are normal artifacts of the cipher, not errors.