Vigenère Cipher Encoder / Decoder

Encode or decode a Vigenère cipher with its keyword. Spaces and punctuation pass through without using up the key.

Letters only — anything else in the keyword is ignored, and case does not matter.

Plain text
Encoded text
Worked example
Plain text
Attack at dawn
Key
keyword LEMON
Encoded
Lxfopv ef rnhr

How the Vigenère cipher works

Vigenère is a run of Caesar ciphers with a different shift for each letter, taken from a keyword. Each keyword letter is a shift — A is 0, B is 1, up to Z at 25 — and the keyword repeats for as long as the message runs. The first letter of the message is shifted by the first letter of the key, the second by the second, and so on, starting the keyword again when it runs out.

Decoding shifts each letter back by the same keyword letter. Only letters use up the key: a space or a comma passes through and leaves the key where it was, which is the classical convention and the one other tools follow. (A tool that advances the key on every character produces output that looks fine and matches nobody else's.)

A worked example

With the keyword LEMON, Attack at dawn becomes Lxfopv ef rnhr. The first A is shifted by L (11) to L, the next T by E (4) to X, the next T by M (12) to F. Notice that the two Ts in "attack" come out as different letters — that is the whole improvement over Caesar.

How it is broken

Because one letter no longer always becomes the same letter, simple frequency counting fails, and for about three centuries the cipher had a reputation as le chiffre indéchiffrable. It was first described by Giovan Battista Bellaso in 1553; the name comes from Blaise de Vigenère, who wrote about a stronger cousin of it later in the century.

The weakness is the repeating keyword. Once you know its length — say five — letters 1, 6, 11, … were all shifted by the same key letter, so the message splits into five interleaved Caesar ciphers, each broken by frequency analysis on its own. Charles Babbage worked this out in the 1850s and Friedrich Kasiski published it in 1863: repeated runs of ciphertext tend to sit a multiple of the key length apart. A keyword as long as the message, and never reused, closes that hole — but that is a one-time pad, not Vigenère.

Everything on this page runs in your browser — nothing you type is sent anywhere. The cipher encoder / decoder runs all five ciphers on one page, and the cipher buttons above switch this one too.

How do I decode a Vigenère cipher?

Choose Decode, type the keyword, and paste the message. Without the keyword you need the key length first (repeated ciphertext runs or the index of coincidence), then each column falls to frequency analysis.

Do spaces and punctuation use up the key?

No. Non-letters pass through and the keyword does not advance over them, so "ATTACK AT DAWN" and "ATTACKATDAWN" encode to the same letters. That is the classical convention.

Does the case of the keyword matter?

No. "lemon" and "LEMON" are the same key, and anything in the keyword that is not a letter is ignored.

This site is vibe coded. The tools here were built largely by AI, so treat what they tell you as a starting point rather than an answer — double-check anything that matters before you rely on it.

Crunchify.net — 139 free tools, no ads, no tracking.