Cipher

Runs in your browser. Your text never leaves your device.

Vigenere Cipher Encoder and Decoder

The Vigenère cipher (Vigenere cipher, Vigenère square) shifts letters by a repeating keyword.

Encoding Plain text to Cipher text
Plain text
Cipher text

Wicdq ckxly sllcr rimvh qdslo fpshe o,eln fpsre dlcwe nkrbd lcvel dipxa gdlwy y

Shown in groups of five. Copy result copies it as is.

Report a wrong result or suggest a code in the Vigenere Cipher tool

Crack without the key

Key found

Solved. Two independent checks agree on the top key.

65 lettersneeds about 60192 keys tried

  1. Keyword KEY readability 81 of 100, higher is better

    Meet me at noon by the old stone bridge, and bring the map and the lantern with you

  2. Keyword HUOPZYKK readability 19 of 100, higher is better

    Pooo re an eeew me hhb shs rfibh lbdige, uet rattu tei ipo mhr wro gfntyid mren mor

  3. Keyword LR readability 15 of 100, higher is better

    Lrrm fl zg ahhu al gax vkq fmhud oebwnd, naw uyhat mal lnc tgk sur etusreg ppsu lhn

Key lengths 1 to 12 tried (index of coincidence favours length 9, Kasiski repeats favour 3). Each key letter is solved by letter frequency, then keys are ranked by a readability heuristic (common English letter groups and words). Higher is better. Scores are a ranking aid, not a guarantee: read the text.

Solved. Best key: Keyword KEY, readability 81 of 100, higher is better.

Recent

Nothing yet. Your last 10 conversions, across every cipher, appear here. They are kept on this device only.

Vigenere Cipher at a glance

Type
Broken cipher (keyed)
Key space
26^n for a key of n letters, but recoverable from ciphertext alone
Directions
Encode and decode: Plain text to Cipher text and back
Example
HELLO → RIJVS (keyword KEY, the tool's default)
Privacy
Runs in your browser, nothing is uploaded

Given enough ciphertext, this tool recovers a Vigenere keyword without being told it: it estimates the key length, then solves each key letter from English letter frequencies.

For centuries it was called the indecipherable cipher, until Babbage and Kasiski showed in the 1800s that the key can be recovered from the ciphertext alone. If you have the keyword, enter it with your text to encrypt or decrypt directly; the keyword and message stay in your browser.

How the Vigenere Cipher works

The keyword is repeated across the length of the message. Each plaintext letter is shifted by the alphabet position of the matching key letter, so the same letter can encrypt differently depending on where it sits.

Decryption reverses each shift using the same key. A longer, less predictable key makes hand analysis harder, but it does not save the cipher: given enough ciphertext, the key length falls out of the repetition pattern and each position is then a plain Caesar shift.

Examples

HELLO key LEMON
SIXZB
Each letter shifts by a different amount.
ATTACK key KEY
KXRKGI
SIXZB key LEMON (decode)
HELLO

Break it without the key

The Vigenere cipher was called indecipherable for three centuries, until Charles Babbage and Friedrich Kasiski showed that the key can be recovered from the ciphertext alone. This runs that analysis and shows each step rather than only the answer.

Step 1: is it polyalphabetic at all?

The index of coincidence for the whole text is 0.0508. English sits near 0.067 and a completely flat distribution near 0.038. This sits well below English, so the same letter is being enciphered differently in different places. That is the signature of a polyalphabetic cipher.

Step 2: how long is the key?

Split the text into columns, one per key position. At the correct key length every column has been shifted by a single amount, so each column looks like ordinary English again and its index of coincidence jumps back up.

Index of coincidence for each candidate key length
Key lengthAverage IC per columnReading
20.0555Leaning English
30.0525Leaning English
40.0539Leaning English
5most likely0.0803Close to English
60.0616Close to English
70.0553Leaning English
80.0570Leaning English
90.0498Flat
100.0833Close to English
110.0539Leaning English
120.0585Leaning English

Step 3: corroborate with Kasiski

Kasiski examination looks for sequences that repeat in the ciphertext. A repeat usually means the same plaintext met the same part of the key, so the distance between the two is a multiple of the key length.

Repeated three-letter sequences and the gaps between them
SequenceDistance between repeats
ELQ170
HEP30
GSI15, 110
IFV70
FVR25, 45

Step 4: recover the key

At a key length of 5, each column is a plain Caesar shift, so each can be solved on its own by frequency analysis. Doing that column by column gives the key LEMON.

Decoded with that key

the treasure is buried under the old oak tree by the river where the two paths meet just beyond the broken wall and you should bring a lantern because the path is dark after sunset and the ground is uneven near the water

If a letter or two of the key looks wrong, that is the analysis being honest rather than broken. Each column is solved from its own letters alone, so a short column can land on the wrong shift. Fix the odd letter by hand once the rest of the text reads as English, and take the key back up to the translator at the top of this page. If the whole thing is nonsense, the key length is probably a multiple of the real one: try the next-highest scoring length in the table above.

History and origins

The method is named after Blaise de Vigenere, a 16th-century French diplomat, though a similar idea was described earlier by Giovan Battista Bellaso. It resisted casual code-breaking for around 300 years.

Charles Babbage and later Friedrich Kasiski found ways to break it in the 19th century by spotting the repeating key length. Even so, it remains a superb tool for understanding polyalphabetic encryption.

Frequently asked questions

How does the Vigenère cipher work, in simple terms? #

Each letter gets its own Caesar shift, set by the keyword letter above it, with A as 0 and Z as 25. The keyword repeats along the message, so ACME with the keyword KEY becomes KGKO.

What is the Vigenère square? #

A 26 by 26 table, also called the tabula recta, in which each row is the alphabet started one letter later. Find the plain letter in the top row and the key letter down the side: where they meet is the cipher letter.

What makes the Vigenere cipher stronger than Caesar? #

Caesar uses one fixed shift, so the same letter always encodes the same way. Vigenere changes the shift for every position using a keyword, hiding the letter-frequency patterns that give Caesar away.

How do I decrypt a Vigenere cipher? #

Enter the same keyword you used to encrypt, switch the tool to decode, and paste the ciphertext. Without the key, paste it anyway: the tool finds the likely key length and keyword by frequency analysis, as long as there is enough text to work with.

How do you find the key length of a Vigenère cipher? #

Split the ciphertext into every n-th letter for each candidate length n and measure the index of coincidence of each column. At the right length the columns look like shifted English, near 0.067; at a wrong length they stay near 0.038. Repeated letter groups help too, because their distances are multiples of the key length (the Kasiski test).

Does the key need to be a real word? #

No. Any sequence of letters works as a key. Longer, more random keys are harder to crack; a key as long as the message is theoretically unbreakable.

How many keys does a Vigenère cipher have? #

26 to the power of the key length: 17,576 keys of three letters and 11,881,376 of five. That is too many to try by hand, which is why breaking it starts from the key length instead of guessing keys.

Who invented the Vigenère cipher? #

Giovan Battista Bellaso described the repeating-keyword method in 1553. Blaise de Vigenère published a stronger autokey cipher in 1586, and the 19th century attached his name to Bellaso's simpler method.

Why was it called the indecipherable cipher? #

Because one plain letter turns into several cipher letters, the letter frequencies that break a Caesar cipher are flattened. It held that reputation for about 300 years, until Charles Babbage broke it in the 1850s and Friedrich Kasiski published a general method in 1863.

Learn more

Go deeper on the ideas behind this tool.

Not sure this is the right tool?

If you have a message and you are not certain what it is, the cipher identifier reads the character set and the letter statistics and tells you which scheme it most likely uses, and why. It covers every code and cipher on this site.

Related translators

Reference this tool

Mention this page in homework, a write-up or an article with this line:

Vigenere Cipher Encoder and Decoder on CipherPad, retrieved on the date of your visit, https://cipherpad.dev/translate/vigenere

The text on this page is licensed CC BY 4.0: you may share and adapt it, also commercially, as long as you credit CipherPad and link to the page.