Vigenère Cipher Decoder (With or Without Key)

By Hommer Zhao · Updated October 30, 2026

Decode with a key, or compare candidate keys

For Vigenère with a known key followed by Atbash, use the multi-step decoder to see both layers in order.

With a keyword, decoding updates as you type. Only A–Z letters consume a key position; case, spaces, digits and punctuation stay in place. Choose Encrypt to create a message using the same repeating keyword.

Without a key, the solver makes English-language guesses. A readable result is a reason to investigate, not proof of the original message. It searches repeating keys up to 20 letters, with a limit of 2,000 letters and 5,000 total characters.

How the no-key solver works

  1. Look for Kasiski repeated sequences of 3–12 letters and their gaps within the first 600 letters.
  2. Rank possible key lengths using those gaps and each length’s average column index of coincidence (IoC).
  3. Try Caesar shifts in each column using chi-squared against English letter frequencies, keeping up to eight key combinations per length.
  4. Rank the decoded text using English letter sequences and key-length evidence; return up to five distinct candidate keys.

For the reasoning and a worked cryptanalysis, read how to decode Vigenère without the key.

A short message with a known key

Our practice note: Bring the blue notebook at noon.

Key: MAP

Ciphertext: Nrxzg ite qxut zoiqbdak pf ndan.

Choose Decode and enter MAP to recover the note exactly. This short example demonstrates keyed decoding; it is not a claim that the no-key solver can recover every short message. Open “Try an example” in the tool for a longer original story to analyze.

The American Cryptogram Association’s Vigenère reference defines the standard rule: add plaintext and key values modulo 26, with A = 0. Decoding subtracts the key.

How often does the solver recover the key?

These 384 trials encrypt public-domain English passages at 50, 100, 200 and 400 letters with seeded random keys of lengths 3–10. The solver receives only the ciphertext, with its usual 1–20 length search. Success requires the entire true key to match.

Exact key recovery, all tested key lengths
LettersTrialsRank #1Top 3
509637.5%36/9639.6%38/96
1009662.5%60/9662.5%60/96
20096100.0%96/96100.0%96/96
40096100.0%96/96100.0%96/96

In this sample, 50 letters recovered the exact key first in 36 of 96 trials. The 200- and 400-letter samples all succeeded, but that is not a guarantee for another message. Long keys leave fewer letters per column; short texts, names, specialist vocabulary and non-English text can produce convincing wrong guesses.

Results by text length and key length

Every row has 12 trials. Percentages are shown with exact counts underneath.

50 ciphertext letters
Key lengthRank #1Top 3
3100.0%12/12100.0%12/12
483.3%10/12100.0%12/12
583.3%10/1283.3%10/12
616.7%2/1216.7%2/12
716.7%2/1216.7%2/12
80.0%0/120.0%0/12
90.0%0/120.0%0/12
100.0%0/120.0%0/12
100 ciphertext letters
Key lengthRank #1Top 3
3100.0%12/12100.0%12/12
4100.0%12/12100.0%12/12
5100.0%12/12100.0%12/12
666.7%8/1266.7%8/12
766.7%8/1266.7%8/12
833.3%4/1233.3%4/12
916.7%2/1216.7%2/12
1016.7%2/1216.7%2/12
200 ciphertext letters
Key lengthRank #1Top 3
3100.0%12/12100.0%12/12
4100.0%12/12100.0%12/12
5100.0%12/12100.0%12/12
6100.0%12/12100.0%12/12
7100.0%12/12100.0%12/12
8100.0%12/12100.0%12/12
9100.0%12/12100.0%12/12
10100.0%12/12100.0%12/12
400 ciphertext letters
Key lengthRank #1Top 3
3100.0%12/12100.0%12/12
4100.0%12/12100.0%12/12
5100.0%12/12100.0%12/12
6100.0%12/12100.0%12/12
7100.0%12/12100.0%12/12
8100.0%12/12100.0%12/12
9100.0%12/12100.0%12/12
10100.0%12/12100.0%12/12
Passages, scoring and reproducibility

Three public-domain works, two letter offsets (0 and 300), and two random keys for every text-length/key-length pair. Windows overlap and reuse passages, so these are descriptive results for a small fixed corpus, not independent samples of all English messages.

Keys come from a fixed 32-bit generator with seed 1447642929; keys with a shorter repeating period are rejected. Text is normalized to uppercase A–Z without padding. The full passages, random keys, ciphertexts, candidate keys and individual ranks are in the benchmark JSON download.

For each possible length, the solver tries the three best chi-squared shifts per column and keeps eight partial keys. It reduces repeated keys to their shortest period. Ranking adds the existing English letter-sequence score to eight times the combined Kasiski/IoC score, then subtracts 0.75 points per key letter. Ties prefer shorter keys and then alphabetical key order. This is a heuristic score, not a confidence percentage or an exhaustive key search.

To regenerate from the source checkout, run node --experimental-strip-types scripts/vigenere-benchmark.ts. The regeneration test checks both JSON copies byte for byte.

Vigenère decoder FAQ

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

Choose Decode, select “I don’t have the key”, paste the ciphertext, and press Find candidate keys. The solver combines Kasiski repeats and column index of coincidence with chi-squared letter analysis, then ranks up to five key and plaintext guesses. Read the candidates and check one with Use this key; a high score does not prove it is correct.

How long does the ciphertext need to be?

There is no guaranteed minimum for a correct solution. This solver accepts 12–2,000 A–Z letters, but fewer than 100 letters often provide too little evidence. Try 200–400 letters if available, especially for longer keys: a 100-letter text with a 10-letter key has only 10 letters per column. The benchmark on this page reports exact key recovery for specific English passages, not a promise for other texts.

Is Vigenère the same as Beaufort or autokey?

No. Repeating-key Vigenère adds the key to the plaintext modulo 26; Beaufort subtracts the plaintext from the key. Autokey extends its initial key with message letters instead of repeating the keyword. This solver assumes repeating-key Vigenère. Use the Beaufort cipher tool or autokey cipher tool for those variants.