Four-Square Cipher
| A | B | C | D | E |
| F | G | H | I | K |
| L | M | N | O | P |
| Q | R | S | T | U |
| V | W | X | Y | Z |
| E | X | A | M | P |
| L | B | C | D | F |
| G | H | I | K | N |
| O | Q | R | S | T |
| U | V | W | Y | Z |
| K | E | Y | W | O |
| R | D | A | B | C |
| F | G | H | I | L |
| M | N | P | Q | S |
| T | U | V | X | Z |
| A | B | C | D | E |
| F | G | H | I | K |
| L | M | N | O | P |
| Q | R | S | T | U |
| V | W | X | Y | Z |
FYNFNEHWBXAFFOKHMD
Encode digraphs through two keyword squares
The four-square cipher encrypts pairs of letters. For each plaintext pair, the first letter is found in the upper-left plain square and the second in the lower-right plain square; the ciphertext reads the upper-right square at the first letter's row and second letter's column, then the lower-left square at the second letter's row and first letter's column. Two keyword squares make it stronger than Playfair, which keys a single square.
When to use this tool
Reach for the four-square cipher when a puzzle, CTF challenge, escape room, or cryptography lesson encrypts letter pairs through two keyword squares. Described by Félix Delastelle and a close relative of Playfair, it spreads each digraph across four 5×5 squares — two plain and two keyed — so a single keyword square is no longer enough to read the message. It sits naturally beside the Playfair and Bifid tools, rounding out the digraph and square family of classical ciphers here.
Privacy and limitations
Everything runs locally in your browser; nothing is sent anywhere. This is a classical cipher, not real encryption — two known keywords make it trivial to reverse. Every square merges J into I, so I and J share one cell and both decode back to I; encoding is case-insensitive and drops every non-letter before pairing. Output is uppercase letters only, an odd-length message is padded with a trailing X, and original case, spacing, and punctuation are not recovered — a round-trip returns the cleaned, uppercased message (with any padding) rather than your exact input. Both keywords are optional; an empty keyword yields the plain A–Z square. Use the encode/decode toggle to switch directions, since the transform is not self-inverse.