Vigenere / Repeating-key cipher

Vigenere cipher decoder

Decode a classic Vigenere message with a known repeating key, or switch deliberately to Encode for a reversible check.

01 / Workspace

Decode ciphertext

Mode

The selected mode is always applied. The tool never guesses the direction, key, or language.

0 / 128 letters

Enter 1 to 128 ASCII letters A-Z or a-z. Case does not change the shifts; spaces, accents, digits, and punctuation are rejected.

0 / 10,000 code points

Only ASCII letters A-Z and a-z are transformed and advance the key. Case is preserved. Whitespace, punctuation, digits, accents, emoji, combining marks, and other scripts pass through unchanged and do not advance it.

Keyboard: press Ctrl+Enter or Command+Enter in the text or key field to run the selected mode.

Ready to decode.

02 / Result

Decoded text

No result yet

Review the result before using it. A plausible result depends on supplying the exact key and matching this tool's character-advancement rule.

03 / Convention

How this decoder works

  1. Number the alphabet from 0. A is 0, B is 1, through Z as 25. Key letters use the same values, regardless of key case.
  2. Repeat the key over participating letters. Each ASCII message letter consumes the next key letter. A space, line break, punctuation mark, digit, accented letter, emoji, combining mark, or non-Latin character consumes no key letter.
  3. Subtract to decode. For ciphertext value C and key value K, plaintext is (C - K + 26) mod 26. Encode uses (P + K) mod 26.
  4. Keep the message shape. Uppercase stays uppercase, lowercase stays lowercase, and every non-ASCII-letter code point is copied unchanged.

Known-answer checks

Classic vector
LXFOPVEFRNHR with key LEMON decodes to ATTACKATDAWN.
Case and spacing
Lxfopv ef rnhr with key lemon decodes to Attack at dawn. Spaces do not consume key letters.
Wrap and punctuation
RIJVS, UYVJN! with key KEY decodes to HELLO, WORLD!.

Limits and security

  • This is standard repeating-key Vigenere over the 26-letter ASCII alphabet. It does not implement autokey, Beaufort, variant Beaufort, running keys, custom alphabets, key recovery, or automatic cryptanalysis.
  • Input is limited to 10,000 Unicode code points and 20,000 UTF-16 code units. The key is limited to 128 ASCII letters. Over-limit or invalid input is rejected in full, with no partial output.
  • JavaScript iterates the message by Unicode code point. Non-ASCII code points are preserved, but visual grapheme clusters are not interpreted. Browser text fields normalize CR and CRLF line endings to LF.
  • A correct key can still produce the wrong text if the source used a different alphabet or advanced its key across spaces and symbols.
  • Classical ciphers are educational and unsuitable for sensitive data. Do not use Vigenere output to protect passwords, personal records, authentication tokens, or confidential messages.