Skip to main content

Playfair Cipher: Encoder, Decoder & Live 5x5 Keyword Square

Encrypt and decrypt with a 5x5 keyword square, digraph pairs and a live grid, browser-only

  • Runs locally
  • Category Encoding & Crypto
  • Best for Checking small payloads, tokens, hashes, and encoded values quickly.
Playfair cipher. The keyword fills a 5×5 square (I and J share a cell), the text is split into letter pairs, and each pair is enciphered by the row / column / rectangle rule. Doubled letters are split with X and an odd tail is padded with X. Decrypt reverses the rules. Classic: PLAYFAIR EXAMPLE + HIDETHEGOLD… → BMODZBXDNABEKUDMUIXMMOUVIF. Built for puzzles and CTF, not real encryption.

Enter a keyword to build the square — letters only, J reads as I.

Input0 chars
Output0 chars
Encrypted / decrypted text appears here.
Keyword square

The 5×5 grid the text runs through. I and J share the I cell. Keyword letters come first, then the rest of the alphabet.

ABCDE
FGHI/JK
LMNOP
QRSTU
VWXYZ

What this tool does

Free online Playfair cipher tool that encrypts and decrypts digraph substitution messages right in your browser. Charles Wheatstone invented the Playfair cipher in 1854, and it works on pairs of letters rather than single ones. A keyword fills a 5x5 square where I and J share a cell, then the rest of the alphabet follows in order. The text is split into letter pairs, a doubled letter is broken with an X and an odd final letter is padded, and each pair is enciphered by one of three rules: same row shifts each letter to its right, same column shifts each down, and a rectangle swaps each letter to the other letter's column. With the classic keyword PLAYFAIR EXAMPLE the plaintext HIDETHEGOLDINTHETREESTUMP becomes BMODZBXDNABEKUDMUIXMMOUVIF. Decrypt runs the rules backward. The tool shows the live keyword square and the exact pairs your text was split into, so you can follow every step. It is 100% client-side with one-click copy and a shareable link that reopens your text, mode and keyword. No upload, no server round-trip.

Tool details

Input
Text
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
Shareable URL state
Key settings are encoded in the URL so another person can reopen the same setup.
Performance budget
Initial JS <= 9 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Encoding & Crypto · Student
Category and role tags drive related tools, internal links, and quick fit checks.

How to use

  1. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 3. Copy / Download

    Copy the result or download to disk in one click.

How Playfair Cipher Encoder & Decoder fits into your work

Use it for quick browser-side encoding, decoding, hashing, token checks, and share-safe transformations.

Encoding jobs

  • Checking small payloads, tokens, hashes, and encoded values quickly.
  • Preparing values for APIs, URLs, docs, or support tickets.
  • Avoiding account-based tools when the input might be sensitive.

Encoding checks

  • Do not paste live secrets unless you are comfortable with local browser handling.
  • Confirm whether the operation is reversible before sharing the result.
  • For hashes, compare the exact algorithm and casing expected by the receiver.

Good next steps

These links move the current task into a more complete workflow.

  1. 1 Polybius Square Cipher Encoder & Decoder Turn letters into 5x5 grid coordinates and back, with a keyword square, origin switch and a live grid, browser-only Open
  2. 2 Vigenère Cipher Encoder / Decoder Encrypt and decrypt with a keyword, polyalphabetic shift, case kept, non-letters passed through, browser-only Open
  3. 3 Caesar Cipher Encoder & Decoder Encrypt, decrypt and brute-force a Caesar shift cipher — all 25 shifts at once, ROT13 shortcut, browser-only Open

Real-world use cases

  • Crack a Playfair CTF challenge

    A crypto task drops a block of paired-up letters like BMODZBXDNABEKUDMUIXMMOUVIF and the hint "5x5, keyword EXAMPLE". Paste the ciphertext, type the keyword, switch to Decrypt, and the digraphs resolve to HIDETHEGOLDINTHETREXESTUMP. The X between TRE and ESTUMP is a filler the encoder slipped in to break a double, so you read past it. The live square shows the exact grid the letters run through, so when a keyword guess is close you can spot a half-right plaintext and adjust instead of decrypting blind.

  • Build a layered escape-room cipher

    You want a puzzle harder than a simple letter shift. Pick a keyword your players can discover on a prop, type the secret phrase, and read off the enciphered pairs to print on a card next to a drawn 5x5 grid. Because Playfair works on pairs, frequency analysis does not crack it at a glance, so the clue stays sturdy. Share the link and a co-organizer reopens the exact same square and ciphertext to verify the solution path before the event.

  • Teach digraph substitution after the simple ciphers

    Playfair is the natural next step once a class has met Caesar and Vigenere: it is the first cipher they see that encrypts two letters at once instead of one. Type a word, watch it split into pairs, and the students see the three rules fire, same row shifts right, same column shifts down, a rectangle swaps corners. The X insertion for doubled letters like the LL in BALLOON makes the "why pairs" question concrete.

  • Decode a historical or wargame Playfair message

    Playfair carried real field traffic from the Boer War through World War II, and reenactors, history students and puzzle hunters still meet it in archives. Paste a period message, enter the unit's keyword, and decrypt to plain text, fillers and all. Match the keyword exactly, since a wrong one reshuffles all 25 cells and the message stays scrambled. The share link carries the keyword so a study group reopens the identical decryption.

Common pitfalls

  • Using a different keyword to decrypt than to encrypt. The keyword builds the entire 5x5 square, so every pair depends on it. Encrypting with PLAYFAIR and decrypting with no keyword or a different one returns a clean-looking but wrong string. The square on screen must match on both ends, so share the link, which carries the keyword.

  • Treating the filler X as part of the message. When a pair would be two of the same letter, like the LL in BALLOON, the encoder splits them with an X, and an odd final letter is padded with X too. On decrypt those X letters come back in the plaintext. Read past a stray X that sits between a doubled letter or at the very end rather than treating it as a real character.

  • Forgetting that I and J share one cell. A 5x5 grid holds only 25 letters, so J is folded into I. JAM and IAM encipher the same way, and decrypted text always shows I, never J. If a word reads IUMP where you expected JUMP, that is the merge, not a bug, and you restore the J by sense.

Privacy

Every encrypt and decrypt runs as plain JavaScript inside your browser tab. The text you type, the keyword you choose and the resulting digraphs never leave the page, and nothing is logged or uploaded. One thing worth saying plainly: Playfair is not real encryption. It is a 19th century pen-and-paper cipher, and a short keyword only reshuffles 25 letters, so a determined analyst can break it by hand with enough ciphertext. Use it for puzzles, CTF practice, history and teaching, never to protect a password or a private note. The shareable link encodes your text, mode and keyword in the query string, so a link pasted into chat lands those characters in the recipient server's access log. Fine for a puzzle, not for anything you truly need kept private.

FAQ

Tool combos

Folks in your role tend to reach for these alongside this tool.

Made by Toolora · 100% client-side · Updated 2026-05-29