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
Enter 1 to 128 ASCII letters A-Z or a-z. Case does not change the shifts; spaces, accents, digits, and punctuation are rejected.
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
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
- 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.
- 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.
- Subtract to decode. For ciphertext value
Cand key valueK, plaintext is(C - K + 26) mod 26. Encode uses(P + K) mod 26. - 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
LXFOPVEFRNHRwith keyLEMONdecodes toATTACKATDAWN.- Case and spacing
Lxfopv ef rnhrwith keylemondecodes toAttack at dawn. Spaces do not consume key letters.- Wrap and punctuation
RIJVS, UYVJN!with keyKEYdecodes toHELLO, 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.