How to use the four-square cipher tool
- Choose the Direction: Encrypt or Decrypt.
- Enter the First keyword (top right); the default is EXAMPLE.
- Enter the Second keyword (bottom left); the default is KEYWORD.
- Pick the 25-letter alphabet: Omit Q or Merge I and J.
- Type into Your text and copy the Result, which is in capitals without spaces.
What it does and when to use it
Félix Delastelle described the four-square cipher in the early 1900s. Like the Playfair cipher it works on pairs of letters, which hides single-letter frequencies, but it uses two separate keyword squares and has no special rules for letters in the same row or column. Doubled letters need no filler either.
People use it in puzzle hunts, geocaching and cryptography courses as a step beyond Playfair. It is a puzzle and teaching cipher; it does not protect real information. For a single-square cipher by the same inventor, see the bifid cipher. The keyword substitution cipher uses the same keyword-alphabet idea in one line.
How it works
With Omit Q, each square holds the 25 letters A to Z without Q. The plain squares sit top left and bottom right; the keyword squares, each starting with its keyword’s letters and then the rest of the alphabet, sit top right and bottom left:
A B C D E E X A M P
F G H I J L B C D F
K L M N O G H I J K
P R S T U N O R S T
V W X Y Z U V W Y Z
K E Y W O A B C D E
R D A B C F G H I J
F G H I J K L M N O
L M N P S P R S T U
T U V X Z V W X Y Z
Encrypting a pair. Find the first letter in the top-left square and the second in the bottom-right square. The first cipher letter is in the top-right square, in the first letter’s row and the second letter’s column. The second cipher letter is in the bottom-left square, in the second letter’s row and the first letter’s column.
For HE: H is row 2, column 3; E is row 1, column 5. Top right, row 2, column 5 gives F. Bottom left, row 1, column 3 gives Y. So HE becomes FY.
Decrypting runs the same lookup backwards from the keyword squares to the plain squares. Only letters are used, and an odd count gets an X when encrypting. It all happens in your browser.
Worked examples
Results from the tool:
Help me Obi Wan Kenobi EXAMPLE / KEYWORD → FYGMKYHOBXMFKKKIMD
same message EXAMPLE / KEYWORD, Merge I and J → FYNFNEHWBXAFFOKHMD
FYGMKYHOBXMFKKKIMD EXAMPLE / KEYWORD, Decrypt → HELPMEOBIWANKENOBI
Quiz EXAMPLE / KEYWORD → SCWZ
The first two lines share their opening FY, then part ways because the squares change. The last line shows Quiz losing its Q and gaining a filler X before encryption; the tool adds a warning that one letter Q was removed.
Limits and tips
- Both keywords must match exactly, and in the right boxes. Swapping them gives a different cipher.
- Word breaks, digits and punctuation are removed, so plan for the reader to add spaces back.
- With Omit Q, any Q is dropped and a warning says so. A Q in ciphertext you are decrypting is ignored with a warning, since Omit Q squares never produce one; it usually means the message used Merge I and J.
Frequently asked questions
Which 25-letter alphabet should I choose?
What happens to the letter Q with Omit Q selected?
Why does my decrypted text end with an X?
How strong is the four-square cipher?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.