Vigenère Cipher Decoder — How to Encode and Decode Step by Step

By Letters2NumbersConverter.com  ·  May 13, 2026

The Vigenère cipher is the most famous polyalphabetic substitution cipher and one of the most searched classical ciphers after the Caesar cipher. Once called “le chiffre indéchiffrable” (the indecipherable cipher), it was the gold standard of secret communication for three centuries — until Charles Babbage cracked it in the 1850s. This guide explains exactly how encoding and decoding works, with a full worked example, the Vigenère square, and a method for breaking it without the key. To decode or encode text right now, try our free Cipher Identifier or Playfair Cipher Solver for related classical ciphers.

What Is the Vigenère Cipher?

The Vigenère cipher is a polyalphabetic substitution cipher — it uses multiple Caesar shifts instead of just one. The key is a word or phrase; each letter of the key determines the shift applied to the corresponding letter of the plaintext. When the key is shorter than the message, it simply repeats.

For example, with key KEY:

  • K = shift 10 (K is the 11th letter, 0-indexed = 10)
  • E = shift 4
  • Y = shift 24
  • Then the key cycles: K, E, Y, K, E, Y, …

Because the same plaintext letter (say, E) can map to three different ciphertext letters depending on which key letter aligns with it, simple letter-frequency analysis fails — the reason the cipher stumped cryptanalysts for so long.

How to Encode with the Vigenère Cipher

Formula: C = (P + K) mod 26, where P is the plaintext letter's position (A=0 … Z=25) and K is the key letter's position.

Worked Example — Encoding “CRYPTOGRAPHY” with key “KEY

PlaintextKey letterPlain pos (P)Key pos (K)(P+K) mod 26Ciphertext
CK210(2+10) mod 26 = 12M
RE174(17+4) mod 26 = 21V
YY2424(24+24) mod 26 = 22W
PK1510(15+10) mod 26 = 25Z
TE194(19+4) mod 26 = 23X
OY1424(14+24) mod 26 = 12M
GK610(6+10) mod 26 = 16Q
RE174(17+4) mod 26 = 21V
AY024(0+24) mod 26 = 24Y
PK1510(15+10) mod 26 = 25Z
HE74(7+4) mod 26 = 11L
YY2424(24+24) mod 26 = 22W

Result: CRYPTOGRAPHYMVWZXMQVYZLW

How to Decode the Vigenère Cipher

Formula: P = (C − K + 26) mod 26. Subtract the key letter's position from the ciphertext letter's position (adding 26 to avoid negative numbers), then take mod 26.

Worked Example — Decoding “MVWZXMQVYZLW” with key “KEY

CiphertextKey letterCipher pos (C)Key pos (K)(C−K+26) mod 26Plaintext
MK1210(1210+26) mod 26 = 2C
VE214(214+26) mod 26 = 17R
WY2224(2224+26) mod 26 = 24Y
ZK2510(2510+26) mod 26 = 15P
XE234(234+26) mod 26 = 19T
MY1224(1224+26) mod 26 = 14O
QK1610(1610+26) mod 26 = 6G
VE214(214+26) mod 26 = 17R
YY2424(2424+26) mod 26 = 0A
ZK2510(2510+26) mod 26 = 15P
LE114(114+26) mod 26 = 7H
WY2224(2224+26) mod 26 = 24Y

Decoded result: MVWZXMQVYZLWCRYPTOGRAPHY

The Vigenère Square (Tabula Recta)

The Vigenère square is a 26×26 grid that makes manual encoding and decoding easier — no arithmetic needed. The rows are labelled by key letter (A–Z) and the columns by plaintext letter (A–Z).

  • To encode: find the row for the key letter, find the column for the plaintext letter — the cell is the ciphertext letter.
  • To decode: find the row for the key letter, scan along that row to find the ciphertext letter — the column header is the plaintext letter.
↓key/plain→ABCDEFGHIJKLMNOPQRSTUVWXYZ
AABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZA
CCDEFGHIJKLMNOPQRSTUVWXYZAB
DDEFGHIJKLMNOPQRSTUVWXYZABC
EEFGHIJKLMNOPQRSTUVWXYZABCD
FFGHIJKLMNOPQRSTUVWXYZABCDE
GGHIJKLMNOPQRSTUVWXYZABCDEF
HHIJKLMNOPQRSTUVWXYZABCDEFG
IIJKLMNOPQRSTUVWXYZABCDEFGH
JJKLMNOPQRSTUVWXYZABCDEFGHI
KKLMNOPQRSTUVWXYZABCDEFGHIJ
LLMNOPQRSTUVWXYZABCDEFGHIJK
MMNOPQRSTUVWXYZABCDEFGHIJKL
NNOPQRSTUVWXYZABCDEFGHIJKLM
OOPQRSTUVWXYZABCDEFGHIJKLMN
PPQRSTUVWXYZABCDEFGHIJKLMNO
QQRSTUVWXYZABCDEFGHIJKLMNOP
RRSTUVWXYZABCDEFGHIJKLMNOPQ
SSTUVWXYZABCDEFGHIJKLMNOPQR
TTUVWXYZABCDEFGHIJKLMNOPQRS
UUVWXYZABCDEFGHIJKLMNOPQRST
VVWXYZABCDEFGHIJKLMNOPQRSTU
WWXYZABCDEFGHIJKLMNOPQRSTUV
XXYZABCDEFGHIJKLMNOPQRSTUVW
YYZABCDEFGHIJKLMNOPQRSTUVWX
ZZABCDEFGHIJKLMNOPQRSTUVWXY

Highlighted cell (row K, col C): M — encoding C with key letter K gives M. ✓ (matches our worked example above)

How to Crack the Vigenère Cipher Without the Key

Breaking the Vigenère cipher is a two-step process: first find the key length, then crack each sub-cipher independently.

Step 1 — Find the Key Length (Kasiski Examination)

Scan the ciphertext for repeated sequences of 3 or more characters. When the same sequence appears multiple times, the distance between occurrences is often a multiple of the key length. Find the GCD of all these distances — that's your likely key length.

Example:if “XKM” appears at positions 14 and 44, the gap is 30. If it also appears at position 74 (gap 30 again), the key length is likely a factor of 30 — so 2, 3, 5, 6, 10, 15, or 30. English words tend to be 3–8 letters, so 5 or 6 are the best guesses.

Step 2 — Crack Each Sub-Cipher with Frequency Analysis

Once you know the key length (say, 5), split the ciphertext into 5 sub-streams: characters at positions 0, 5, 10, … then 1, 6, 11, … and so on. Each sub-stream is a simple Caesar cipher. Apply frequency analysis to each — the most common letter in English text is E (12.7%), so the most frequent ciphertext letter in each stream likely corresponds to E. The difference gives you each key letter.

Our Text Frequency Analysis tool can help you analyse letter distributions quickly.

More Vigenère Cipher Examples

PlaintextKeyCiphertext
HELLO WORLDSECRETZINCS PGVNU
ATTACK AT DAWNLEMONLXFOPV EF RNHR
THE QUICK BROWN FOXCIPHERVPT XYZES QYSNP NDE
ESCAPE ROOM PUZZLEMAZEQSBEBE QSAM OYLZKI
VIGENERE IS STRONGBABBAGEWIHFNKVF IT TTXSOG

Vigenère vs. Caesar — Key Differences

FeatureCaesar CipherVigenère Cipher
TypeMonoalphabeticPolyalphabetic
KeySingle number (1–25)Word or phrase
Same letter maps toSame ciphertext alwaysDifferent ciphertext each position
Crack with frequency analysis?Yes — triviallyNot directly
Key space25 possibilitiesMillions (depends on key length)
Practical securityNoneNone (broken 1863)

Frequently Asked Questions

What is the Vigenère cipher?

The Vigenère cipher is a polyalphabetic substitution cipher that uses a repeating keyword to shift each letter of the plaintext by a different amount. Each letter of the key determines the shift for the corresponding letter of the message, making it significantly harder to crack than the Caesar cipher.

How do I decode a Vigenère cipher without the key?

Use Kasiski examination to estimate the key length (look for repeated 3-letter sequences and take the GCD of their spacings), then apply frequency analysis to each Caesar sub-cipher. The most common ciphertext letter in each position likely encodes E — the difference gives you each key letter.

What is the Vigenère square?

The Vigenère square (tabula recta) is a 26×26 grid where each row is the alphabet shifted by one position. To encode, find the row for the key letter and the column for the plaintext letter — their intersection is the ciphertext letter. To decode, find the ciphertext letter in the key letter's row; the column header is the plaintext letter.

How is the Vigenère cipher different from the Caesar cipher?

The Caesar cipher uses a single fixed shift for every letter — the same letter always produces the same ciphertext, making frequency analysis trivial. The Vigenère cipher uses a keyword so each letter is shifted differently, meaning the same plaintext letter produces different ciphertext letters at different positions. This defeats simple frequency analysis.

Is the Vigenère cipher secure?

No — it was broken in the 19th century using Kasiski examination and Friedman's Index of Coincidence. Modern encryption (AES, RSA, ChaCha20) is computationally infeasible to crack and should be used for any real security requirement.

Explore More Cipher Tools

The Vigenère cipher is one of many classical ciphers worth learning. Try these free tools on our site: