🎖️ ADFGVX Cipher

Encrypt and decrypt text with the ADFGVX cipher. A WWI German field cipher combining a 6x6 Polybius substitution with columnar transposition.

About the ADFGVX Cipher

The ADFGVX cipher is a manual field cipher used by the German Army during the final months of World War I (introduced March 1918). It was designed by Lieutenant Fritz Nebel and is a fractionating cipher that combines two steps: a Polybius-style substitution using a 6x6 grid, followed by a columnar transposition. The name comes from the six letters used as coordinates — A, D, F, G, V, X — chosen because they are easily distinguished in Morse code. This tool runs entirely in your browser — nothing is uploaded.

How it works

  • Build the grid — A 6x6 grid holds the 36 symbols A–Z and 0–9. The optional Polybius key (duplicates removed) fills the grid first, followed by the remaining symbols in order. Rows and columns are labeled A, D, F, G, V, X.
  • Step 1 — Substitution — Each plaintext character is replaced by the two-letter coordinate (row letter + column letter) of its cell. For example, in the standard grid 'A' becomes 'AA' and 'B' becomes 'AD'.
  • Step 2 — Transposition — The coordinate string is written row by row under the transposition keyword. Columns are then read off in alphabetical key order to produce the ciphertext.
  • Decrypt — Reverse the transposition first (reconstructing the column grid from the keyword), then reverse the substitution to recover the original characters.

Use cases

  • Studying classical fractionating ciphers and the combination of substitution with transposition.
  • Understanding how a relatively strong manual cipher resisted casual codebreaking.
  • Building historical cryptography exercises and puzzles.
  • Appreciating how ADFGVX was eventually broken by French cryptanalyst Georges Painvin in 1918.

Frequently asked questions

Why the letters A, D, F, G, V, X? These six letters have very distinct Morse codes, reducing confusion when the cipher was transmitted over noisy field telegraph lines.

What does the Polybius key do? It scrambles the order of symbols in the 6x6 grid. Without it, the grid uses the standard order A–Z then 0–9. The key must contain only letters and digits.

Why are there two keys? The Polybius key controls the substitution grid; the transposition key controls how the coordinate stream is rearranged. Both are needed to decrypt.

Is ADFGVX secure today? No. It was broken in 1918 and is easily handled by modern computers. It is a historical cipher for learning and entertainment.

Does this tool upload my text? No. All encryption and decryption happens locally in your browser.