Skip to content

Vigenère cipher decoder and encoder

Apply a repeating English keyword as a different Caesar shift for each A–Z letter, with explicit Encode and Decode directions.

Cipher input

Processed in your browser.

Up to 500 characters. Only English A–Z letters change; case, spaces, punctuation, numbers, and other scripts are preserved.

English letters A–Z only, without spaces or punctuation.

Converted text

Enter a short message, then select Convert.

How to use the Vigenère cipher translator

  1. Enter a short plaintext or ciphertext message, then choose Encode or Decode.
  2. Enter a keyword made only of English A–Z letters. Case in the key is ignored; spaces, digits, accents, and punctuation are rejected so the convention stays unambiguous.
  3. Select Convert. The key repeats across English letters only. A space or punctuation mark is preserved and does not consume the next key letter.
  4. Copy result copies exactly the transformed text. Editing message, keyword, or direction immediately clears the previous output and copy status.

Vigenère formula and key alignment

Number A through Z from 0 to 25. Each key letter supplies a shift K: A means 0, B means 1, and Z means 25. Encoding uses Cᵢ=(Pᵢ+Kᵢ) mod 26; decoding uses Pᵢ=(Cᵢ−Kᵢ) mod 26. When the keyword ends, it starts again.

This implementation preserves the case of each message letter. It advances the key index only when the current message character is an unaccented English letter. Thus ATTACK AT DAWN with LEMON aligns the same way as ATTACKATDAWN. Spaces, punctuation, numbers, emoji, accents, and non-Latin scripts remain unchanged and do not change the alignment. This convention is stated because other historical or software variants may strip non-letters first.

Exact Vigenère examples

The standard vector with plaintext ATTACKATDAWN and keyword LEMON produces LXFOPVEFRNHR. Decode that ciphertext with LEMON to restore ATTACKATDAWN.

With spaces and case preserved, Attack at dawn! + LEMON → Lxfopv ef rnhr!. In A-BC D with keyword BC, the hyphen and space do not consume key letters, producing B-DD F.

When a keyword cipher tool helps

Keyword, text, and security limits

Vigenère cipher FAQ

Do spaces advance the keyword?

No. Only A–Z or a–z in the message consumes a key letter; all other characters stay in place.

Does keyword case change the result?

No. lemon and LEMON supply the same shifts, while message letter case is preserved.

Why is my keyword rejected?

This page requires a single A–Z word. Remove spaces, digits, punctuation, accents, and other scripts.

Can the decoder discover a missing keyword?

No. It performs exact conversion with the key provided and does not promise an automatically inferred plaintext.