Vigenère Cipher Encoder/Decoder
Encode and decode messages with the classic Vigenère keyword cipher.
Result
How it is calculated
The Vigenère cipher shifts each letter of the text by an amount taken from a repeating keyword. Each keyword letter is turned into a shift from 0 to 25 (A = 0, B = 1, … Z = 25). For a plaintext letter P and key shift K, encoding gives C = (P + K) mod 26, and decoding gives P = (C − K) mod 26. The key is used letter by letter and starts over when it ends. It only moves forward on letters: spaces, digits and punctuation are copied unchanged and do not use up a key letter. Upper and lower case are kept as typed. Only A to Z count, so accented or non-English letters in the key are ignored and in the text are left as they are. A key with no usable letters returns nothing.
Worked example
Encode "Attack at dawn" with the key LEMON. The key letters give shifts L = 11, E = 4, M = 12, O = 14, N = 13, repeating. A + 11 = L, t + 4 = x, t + 12 = f, a + 14 = o, c + 13 = p, k + 11 = v (the key starts over at L). The space is copied and does not use a key letter. Continuing gives the full result: Lxfopv ef rnhr. Choosing decode with the same key and this text returns "Attack at dawn".
Common mistakes
- Decoding with the encode setting (or the other way round). The same key then shifts letters further instead of undoing the shift.
- Thinking spaces use up key letters. They do not, so a puzzle solved by counting positions that include spaces will not match.
- Putting digits or punctuation in the key and expecting them to count; they are ignored, so "KEY2" acts like "KEY".
- Expecting accented letters such as é or ğ to be enciphered. Only the 26 basic letters are shifted; others pass through unchanged.
About this calculator
This tool encrypts or decrypts text with the Vigenère cipher, a polyalphabetic substitution cipher that shifts each letter of the plaintext by an amount determined by the corresponding letter of a repeating keyword, using what's known historically as the tabula recta. Because the shift changes from letter to letter, it defeats simple frequency analysis that breaks single-shift ciphers like Caesar's.
Used for centuries as a "le chiffre indéchiffrable," it's now mainly a teaching tool for cryptography students, puzzle and CTF (capture-the-flag) enthusiasts, and hobbyists exploring classical ciphers.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
This is a teaching cipher, not protection for anything private: a short keyword leaves patterns that frequency analysis can find. Puzzle books also differ on spaces. Here spaces and punctuation are copied as they are and do not use up a key letter, so output may not match a book that counts them. Only A to Z letters of the key count. Which convention does your puzzle or class assignment use?