The standard Vigenere decoding operation applies the repeating-key modular subtraction p = (c - k + 26) mod 26 to every ASCII letter in the ciphertext, mapping A through Z to the values 0 through 25 and ignoring every other character. Decryption reverses encryption letter by letter: for each position in the message that holds an ASCII letter A-Z or a-z, the decoder subtracts the current key letter's shift (A=0, B=1, ..., Z=25) from the ciphertext letter's value, wraps negative results back into the 0-25 range by adding 26, and emits the matching letter in the source letter's original case. When the message contains more participating letters than the key, the key repeats from its first letter - a 5-letter key applied to a 12-letter message uses shifts 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2. The Vigenere Cipher Decoder performs that arithmetic entirely inside the active browser tab, so your ciphertext and key never leave the device. It expects you to already know the correct repeating key; it cannot discover, estimate, or guess it.
Decoding differs from encryption only in the direction of the shift. Encryption adds the key letter's value to the plaintext letter's value modulo 26, so encryption and decryption with the same key are mathematical inverses. That symmetry is what makes the cipher trivially reversible the moment you have the key, and it is also the structural property that lets a browser tool perform decoding in a single pass over the input without keeping any intermediate state beyond the current key position and a running output string.

How Vigenere Decoding Math Works Letter by Letter
Every Vigenere decoding step has three ingredients: the ciphertext letter's numerical position in the alphabet (A=0 through Z=25), the current key letter's numerical position using the same A=0 mapping, and the modulus 26 that wraps the result back into the 26-letter range. For an uppercase ciphertext letter C with value c and a key letter K with value k, decryption computes the plaintext value p = (c - k + 26) mod 26, then maps p back to a letter. Adding 26 before taking the modulus is the trick that keeps results non-negative when c < k - without it, a letter such as A with the key letter C would produce -2 instead of the intended 24.
The canonical worked example for the ATTACKATDAWN message with the LEMON key illustrates the round trip. Encryption produces the ciphertext LXFOPVEFRNHR letter by letter: A(0)+L(11)=L, T(19)+E(4)=23 -> X, T(19)+M(12)=31 -> 5 -> F, A(0)+O(14)=O, C(2)+N(13)=P, K(10)+L(11)=V, A(0)+E(4)=E, T(19)+M(12)=5 -> F, D(3)+O(14)=R, A(0)+N(13)=N, W(22)+L(11)=33 -> 7 -> H, N(13)+E(4)=R. Decoding reverses every step: L(11)-L(11)=0 -> A, X(23)-E(4)=19 -> T, F(5)-M(12)=-7+26=19 -> T, O(14)-O(14)=0 -> A, P(15)-N(13)=2 -> C, V(21)-L(11)=10 -> K, E(4)-E(4)=0 -> A, F(5)-M(12)=19 -> T, R(17)-O(14)=3 -> D, N(13)-N(13)=0 -> A, H(7)-L(11)=-4+26=22 -> W, R(17)-E(4)=13 -> N. The output reconstructs ATTACKATDAWN exactly. That pair is one of the standard reference cases in classical cryptography education, including the worked examples collected in Cornell CS 1132 Assignment 2 and the CrypTool teaching materials.
Three conventions of the decoder are worth internalizing before you run a real message:
- Only ASCII letters advance the key. A space, comma, period, digit, accent, emoji, CJK ideograph, or any other non-ASCII-letter code unit is copied into the output verbatim and consumes zero key positions. The very next ASCII letter uses the very next key shift. This matters when the ciphertext contains punctuation between letters, because hand-decoded attempts that count every character - including spaces - against the key will misalign by exactly one position per intervening nonletter.
- Source case is preserved. An uppercase ciphertext letter decodes to an uppercase plaintext letter, a lowercase ciphertext letter decodes to a lowercase plaintext letter, and the key letters themselves are normalized internally to uppercase before the modular arithmetic runs.
- Keys are case-insensitive. LEMON, lemon, and Lemon all generate the same shift sequence (11, 4, 12, 14, 13). The key field accepts letters only - no spaces, digits, punctuation, accents, or symbols - and the maximum length is 256 letters.
Decode a Vigenere Cipher With a Key in Your Browser
- Open the Vigenere Cipher Decoder tool in your browser tab. The interface accepts plaintext for encryption or ciphertext for decryption up to 500,000 UTF-16 code units.
- Paste your ciphertext into the text field. Use the source message exactly as you received it, preserving every space, line break, digit, punctuation mark, and Unicode character - those characters are passed through unchanged during decoding.
- Enter the known key into the key field. Type only ASCII letters A-Z or a-z (any case); the decoder normalizes the key to uppercase internally, so "lemon", "LEMON", and "Lemon" all generate the same shifts.
- Select the Decrypt mode. The tool requires you to choose a direction explicitly so it can subtract instead of add the modular shift.
- Run the transformation. Decoding happens entirely inside the current browser tab - no network request is sent and no account is required.
- Copy the labeled result using the Copy button next to the output box. The output is labeled "plaintext" because you selected decryption, but the label is descriptive of the operation, not a guarantee that the text is meaningful English.
- Keep the exact key alongside the result whenever you exchange the puzzle. Other Vigenere programs may advance the key across spaces, normalize characters differently, or treat non-ASCII letters as key consumers; that mismatch silently produces gibberish from a correct key, so retaining the alignment convention matters as much as retaining the key itself.
What the Decoder Transforms and What It Preserves
The decoder applies the modular shift to a narrow subset of input characters and copies everything else verbatim. The table below summarizes the behavior the tool is contractually guaranteed to perform, so you can predict the output without running the tool first.
| Input character | Effect on output | Effect on key index |
|---|---|---|
| ASCII uppercase A-Z | Shifted to another A-Z letter using the current key shift | Advances by one |
| ASCII lowercase a-z | Shifted to another a-z letter; preserves lowercase | Advances by one |
| Space, tab, line break | Copied unchanged | Does not advance |
| Digit 0-9 | Copied unchanged | Does not advance |
| Punctuation (.,;:!?-'" etc.) | Copied unchanged | Does not advance |
| Accented Latin letters (e, n, u) | Copied unchanged | Does not advance |
| CJK characters, emoji, combining marks | Copied unchanged | Does not advance |
| Key letter (any case) | Normalized to uppercase internally | Used as the current shift |
Two consequences follow directly from that contract. First, a ciphertext like "LXF OPVE FRNHR" (with spaces) decodes the same way as "LXFOPVEFRNHR" because the spaces do not consume key letters; both produce "ATTACKATDAWN" with the LEMON key. Second, an emoji or accented character inserted into the message between two ASCII letters will appear in the output without shifting the alignment - useful when you need to verify a decode against a message that has been copy-pasted with stray formatting characters.
Limits, Errors, and How the Output Behaves
The decoder enforces a hard ceiling of 500,000 UTF-16 code units on the text input. That count is JavaScript's native string length, so a supplementary emoji counts as two code units and a basic Latin letter counts as one - the same measurement JavaScript uses for memory. Text exactly at the limit is transformed in full. Text above the limit is rejected as a whole with an explicit message; the tool does not silently process a prefix or display a partial result that looks complete. The key input has a separate ceiling of 256 ASCII letters, and a key that contains spaces, digits, punctuation, accents, or symbols - or is empty - produces a direct error with no partial output.
Output management is intentionally aggressive. Editing the text, the key, or the mode immediately removes the previous result and any prior error message, so an old ciphertext cannot linger on the screen after you have changed the inputs. The Clear control removes the text, key, output, and error together. That behavior is useful when you are stepping through several candidate keys against the same ciphertext: the stale decode from a wrong key disappears the moment you type the next key letter, which keeps you from accidentally reading last key's output as this key's result.
The output is labeled "plaintext" when you select Decrypt and "ciphertext" when you select Encrypt, but the label describes the operation you requested, not a verification that the result is meaningful. Supply the wrong key and the tool still produces a perfectly valid (but garbage) plaintext; it has no way to detect that you mistyped a letter, transposed two characters, or used a key from a different cipher variant. Always sanity-check the output for a recognizable word, an expected phrase, or a known plaintext fragment before treating it as the real message.
Why This Is a Decoder, Not a Cipher Breaker
The Vigenere Cipher Decoder performs exactly one job, which is converting ciphertext to plaintext when you supply the correct repeating key. It does not analyze letter frequencies, estimate the key length with Kasiski examination or the index of coincidence, score candidate plaintexts against a dictionary, brute-force the keyspace, or rank possible keys by likelihood. Decrypt mode with the wrong key still produces output, but that output is the modular subtraction of your supplied key - it is not a hint, a partial decode, or a best-guess candidate. The historical cipher is fully breakable against meaningful English plaintext using standard statistical attacks, which is precisely why the tool deliberately omits any cracking capability.
Use this tool for the things Vigenere is actually good at: teaching modular arithmetic and polyalphabetic substitution, working through classroom exercises, solving escape-room clues and recreational ciphers, decoding historical examples, and verifying your own hand calculations. Do not use it for passwords, authentication tokens, financial details, personal records, confidential messages, or any data whose disclosure matters - repeating-key Vigenere leaks statistical structure that modern computers can exploit quickly, and the browser decoder provides no authenticated encryption, no key derivation, and no integrity check. For anything security-sensitive, use a maintained modern cipher with authenticated encryption and proper key management, and keep historical ciphers in the teaching category where they belong.