Built and fact-checked by the DocNectar team — see our editorial standards
Key Features
Instant Calculation
Get accurate results in real time with our optimized algorithm.
Mobile Friendly
Fully responsive design. Works on all devices & screen sizes.
Privacy Focused
Your data stays on your device. We don't store any inputs.
100% Free
No hidden costs. This tool is completely free forever.
The Playfair cipher, invented in 1854, was the first practical technique to encrypt pairs of letters (digraphs) instead of single letters, making it much harder to break with simple frequency analysis than a Caesar or Vigenère cipher.
This tool encrypts or decrypts text using a Playfair cipher built from a keyword you choose.
How it works
Your keyword's unique letters fill a 5x5 grid first (I and J share a cell), then the rest of the alphabet fills the remaining cells in order. The text is split into letter pairs — an X is inserted between repeated letters in a pair, and at the end if there's a letter left over. Each pair is then transformed using three rules: pairs in the same row shift right (or left to decrypt), pairs in the same column shift down (or up), and pairs forming a rectangle swap columns.
- Enter mode.
- Enter text.
- Enter keyword.
- Click Calculate to see your results.
Examples
Keyword "PLAYFAIREXAMPLE"
"Hide the gold in the tree stump" encrypts to a scrambled letter sequence — note the tool inserts an X between the double E in "tree" before encrypting, which shows back up when decrypting.
Who should use it
- Puzzle and escape-room style word games.
- Teaching digraph (letter-pair) substitution as a step up from single-letter ciphers.
Industry applications
- Cryptography education
- Games and puzzles
Advantages
- Much stronger against basic frequency analysis than single-letter substitution ciphers.
- Historically used for real military communication (notably by the British in both World Wars).
Limitations
- Still breakable with digraph frequency analysis given enough ciphertext.
- Requires careful handling of repeated letters and odd-length text (the X-insertion rules).
Common mistakes to avoid
- Using a different keyword for decryption than the one used to encrypt — the grid must match exactly.
- Not expecting the inserted X characters that appear between repeated letters or at the end of an odd-length message.
Best practices
- Use the Playfair cipher for puzzles or teaching digraph substitution — it saw real historical military use but offers no real security against modern computing.
Tips
- If your decrypted result has an unexpected X, check whether the original text had a repeated letter pair (like "LL") or an odd total length — both trigger an inserted X.