Vigenère Cipher Tool

Encrypt and decrypt with the Vigenère cipher in Standard, Autokey, Beaufort and Variant Beaufort modes, then see how it is broken with a frequency chart and a key cracker.
100% client-side · A classical cipher for learning, not for real secrets

In the Cipher tab this is the text to encrypt or decrypt. In the Frequency and Crack tabs, treat it as the ciphertext you are analyzing.
Operation
Any characters that are not letters are ignored.

Key stream (first 24 letters): the key letter applied to each message letter.

0
Letters processed
-
Key letters used

The Vigenère cipher has been breakable since the 1800s. Use it to learn, never to protect real information.

How the Vigenère Cipher Works

Write the key under the message, repeating it, and shift each message letter by the key letter beneath it. With the key LEMON, the message ATTACKATDAWN becomes LXFOPVEFRNHR. Because the shift changes from letter to letter, a plain frequency count of the ciphertext looks flat, which fooled people for centuries.

The weakness is the repeating key. Letters that sit a whole number of key lengths apart were shifted the same way, so splitting the ciphertext into columns turns the cipher back into several simple Caesar ciphers. Finding the key length (Kasiski examination or the index of coincidence) is all that is needed to break it.

Four Modes

Standard, Autokey, Beaufort and Variant Beaufort, each with a correct decryption

Key Stream View

See which key letter is applied to each message letter

Frequency Analysis

Chart against English with index of coincidence and entropy

Key Cracker

Detects the key length and solves each key letter statistically

Honest Limits

Clear about how much text the cracker needs and when it is guessing

Private by Design

Runs in your browser. Nothing is uploaded, saved or logged

Frequently Asked Questions

1. What is the Vigenère cipher?

The Vigenère cipher encrypts text with a keyword. Each key letter sets a Caesar shift (A = 0, B = 1, ... Z = 25), and the shifts are applied to the message letters in turn, repeating the keyword as needed. Because one plaintext letter can become different ciphertext letters, it is called polyalphabetic. It is often credited to Blaise de Vigenère but was first described by Giovan Battista Bellaso in 1553, and for centuries it was known as le chiffre indéchiffrable, the indecipherable cipher.

2. How does encryption work? Can I see an example?

Add each key letter to the matching message letter, modulo 26. Encrypting ATTACKATDAWN with the key LEMON gives LXFOPVEFRNHR: A + L = L, T + E = X, T + M = F, A + O = O, C + N = P, then the key repeats with K + L = V, and so on. The Encrypt / Decrypt tab shows this letter by letter in its key stream view.

3. What do the four modes do?

Standard repeats the key: C = P + K. Autokey uses the key once and then continues with the message itself, so the key never repeats; the receiver needs the same starting keyword. Beaufort computes C = K - P, which is its own inverse, so encrypting and decrypting are the same operation. Variant Beaufort computes C = P - K and decrypts with P = C + K, which is the Standard cipher run backwards. All arithmetic is modulo 26.

4. Is the Vigenère cipher secure?

No. It resisted attack for about 300 years, but Friedrich Kasiski published a general method in 1863 and later statistical methods such as the index of coincidence make it routine to break. Once the key length is known, each key letter is just a Caesar cipher that frequency analysis solves. Longer, random keys make it harder, and a random key as long as the message that is never reused (a one-time pad) is unbreakable, but at that point the Vigenère structure is no longer what protects you. For real secrets use AES or another modern cipher.

5. How does the key cracker work, and what are its limits?

First it finds the key length: for each possible length it splits the ciphertext into columns and averages their index of coincidence. At the true length every column is a Caesar-shifted piece of English, which scores about 0.067, while wrong lengths score closer to 0.04. It then solves each column by trying all 26 shifts and keeping the one whose letter counts best match English (a chi-squared score). It needs enough text, roughly 20 or more letters per key letter, so short messages and long keys give guesses, not answers. The cracker is built for Standard Vigenère ciphertext.

6. What do the index of coincidence and entropy mean?

The index of coincidence (IC) is the chance that two letters picked at random from the text are the same. English scores about 0.067, uniformly random letters about 0.038, and a Vigenère ciphertext falls in between, closer to 0.038 as the key gets longer. Entropy measures how evenly letters are spread, in bits per letter: English is around 4.2 and the maximum for 26 letters is 4.70. Both are computed from the letters only.

7. How are spaces, punctuation, case, non-English letters and the key handled?

By default only the letters A-Z are changed: case is kept, and spaces, digits and punctuation pass through (and do not use up key letters). "Letters only" drops everything except letters and gives uppercase output. Letters outside A-Z, such as é or ñ, are left as they are. In the key, anything that is not A-Z is ignored, and the tool shows you the key it actually used.

8. Is my text or key sent or stored anywhere?

No. Everything runs in your browser, the page's content security policy blocks outgoing network requests, and nothing you type is saved: there is no history and no local storage. The only thing the site remembers is your language choice for the menu.