Beaufort Cipher
Encode and decode messages with the reciprocal Beaufort cipher.
Result
How it is calculated
Each letter is turned into a number, A = 0 to Z = 25. For plaintext letter P and the current key letter K, the output letter is C = (K − P) mod 26. The key repeats cyclically, and it advances only when a letter is processed. Spaces, digits and punctuation are copied unchanged and do not consume key letters. Upper and lower case are treated alike and the result is always written in capitals. Non-letters in the key (digits, symbols) are ignored; a key with no letters at all, or empty text, gives no result. Because the formula is symmetric, entering the ciphertext with the same key gives back the plaintext, though the case of the original is lost. Accented letters such as Ü are not part of the 26-letter alphabet and are passed through untouched.
Worked example
Encrypt Attack at dawn! with the key LEMON. Key letters as numbers: L = 11, E = 4, M = 12, O = 14, N = 13. First letter: A = 0, so 11 − 0 = 11, which is L. Second: t = 19, key E = 4, so 4 − 19 = −15, add 26 to get 11, which is L. Third: t = 19, key M = 12, so 12 − 19 = −7, add 26 to get 19, which is T. Continuing this way, with the spaces and the exclamation mark left alone, the tool outputs LLTOLB ET LNPR!
Common mistakes
- Expecting Vigenère output. Beaufort subtracts the plaintext from the key, so the same text and key give a different result than Vigenère.
- Looking for a separate decrypt mode. There is none; paste the ciphertext back in with the same key.
- Using a key containing digits or symbols and expecting them to count. Only letters are used, so
k3ybehaves exactly likeky. - Expecting the key to restart after every word. It runs continuously across the whole message and skips spaces.
- Expecting lowercase or accents back after decrypting. The result is uppercase, and letters outside A to Z are not encrypted.
About this calculator
This tool encrypts or decrypts text with the Beaufort cipher, a polyalphabetic cipher closely related to Vigenère but defined as ciphertext = key − plaintext (mod 26) instead of plaintext + key. This makes it reciprocal: running the exact same operation with the same key on the ciphertext recovers the plaintext, so encryption and decryption use one identical process.
Named after Sir Francis Beaufort (though invented by Giovanni Sestri), it was later built into mechanical cipher machines, most famously the Hagelin M-209 of the Second World War. Cryptography students and enthusiasts use this calculator to explore reciprocal ciphers and compare them to Vigenère.
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)
A handy self-test: encrypt a sentence, paste the output back in with the same key, and you should get the original text in capital letters, since this cipher is reciprocal. If you do not, check the key for stray digits or symbols, because only letters count. Remember it is a historical cipher that frequency analysis can break, so enjoy it for puzzles and learning, not for protecting anything private. Which classical cipher would you like to see compared with it?