Vigenere Cipher

Encode or decode a Vigenere cipher with a keyword, the polyalphabetic cipher that resisted frequency analysis for three centuries.

5Effective key length
12Letters processed
23.5 bitsKey entropy if randomly chosen
2.4Times the key repeats over the text

Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.

What the Vigenere Cipher does

Use this vigenere cipher to encode or decode a Vigenere cipher with a keyword, the polyalphabetic cipher that resisted frequency analysis for three centuries. Paste your text in, pick the options you need, and copy the result straight back out. It is most often used for solving or setting a Vigenère puzzle or escape-room clue. We run a second free tools site as well — FreeToolStation.org.

How to use it

  1. Paste the text you want to encode or decode.
  2. Enter the keyword. Only letters count; case is ignored.
  3. Tick Decode to reverse the process with the same keyword.
  4. Check the repeats figure — the more times a short key cycles over a long message, the easier it is to break.

How it works

The Vigenère cipher is a Caesar cipher whose shift changes with every letter, driven by a repeating keyword. With the key LEMON, the first letter shifts by 11 (L), the second by 4 (E), the third by 12 (M), and so on, restarting after five letters. The classic worked example is ATTACK AT DAWN with the key LEMON, which encodes to LXFOPV EF RNHR — exactly what this page produces.

Its strength over a simple shift is that one plaintext letter maps to several different ciphertext letters depending on where it falls, which flattens the frequency distribution and defeats the straightforward counting attack that breaks Caesar. That resistance earned it the name "le chiffre indéchiffrable" and it stood, broadly, from its publication in 1586 until the nineteenth century.

It is nonetheless thoroughly broken. The weakness is the repetition: once you know the key length, the ciphertext splits into that many separate Caesar ciphers, each solvable by frequency analysis. Finding the key length is the Kasiski examination — look for repeated sequences in the ciphertext and measure the distances between them, which tend to be multiples of the key length. Friedman's index of coincidence gives the same answer statistically. Both were published in the 1800s and early 1900s, and a computer does the whole job instantly.

The key advances only on letters here, so spaces and punctuation do not consume key characters. That is the standard convention and it means your ciphertext keeps the original word structure, which leaks information. A long random key the same length as the message, never reused, is the one-time pad and is genuinely unbreakable — but a short repeating keyword is not a one-time pad, and this cipher belongs in puzzles and history lessons rather than anywhere near real data.

When to use it

  • Solving or setting a Vigenère puzzle or escape-room clue.
  • Decoding a Vigenère ciphertext when you have the keyword.
  • Teaching polyalphabetic ciphers and the Kasiski examination.
  • Demonstrating why key reuse breaks a stream cipher.

Common mistakes to avoid

  • Believing it is secure. The Kasiski examination has broken it since the 1860s and a computer does it in milliseconds.
  • Using a short keyword on a long message. The more times the key repeats, the easier the attack.
  • Mismatching the keyword between encoding and decoding. Even one letter different garbles everything from that position onwards.

Frequently asked questions

What does ATTACK AT DAWN become with the key LEMON?

LXFOPV EF RNHR. This is the standard textbook example, and it is a useful check that any Vigenère implementation is handling the key alignment correctly.

How is the Vigenere cipher broken?

First find the key length, using the Kasiski examination on repeated ciphertext sequences or Friedman's index of coincidence. Then split the ciphertext into that many groups, each of which is a plain Caesar cipher, and solve each by letter frequency.

Is it the same as a one-time pad?

No, and the difference is everything. A one-time pad uses a truly random key as long as the message, used exactly once, and is provably unbreakable. Vigenère uses a short key that repeats, and that repetition is precisely what the attacks exploit.

Related tools

See all security & privacy tools →