About this tool
The Beaufort Cipher is a polyalphabetic cipher named after the naval officer Sir Francis Beaufort. Like Vigenère it uses a repeating keyword, but its rule is subtractive: each ciphertext letter is C = (K − P) mod 26, where P is the plaintext letter and K is the current keyword letter (both indexed 0–25). This tool applies the cipher in the browser and displays the running keystream so you can see exactly which key letter aligns with each character.
The standard Beaufort is self-reciprocal (an involution): because subtraction is symmetric in the tableau, running the same operation with the same key a second time returns the original text. That means one operation both encrypts and decrypts — encode and decode are identical for the standard variant. The tool also offers the German (variant Beaufort) mode, C = (P − K) mod 26, which is not self-inverse; for that mode the encode and decode directions differ and are handled separately (decode uses P = (C + K) mod 26).
Everything is computed locally and privately. The keyword repeats to the length of the text, advancing only on letters so that spaces and punctuation pass through unchanged, and letter case is preserved. Beaufort is distinct from Vigenère precisely because of its subtractive, reciprocal rule — a small change with a neat mathematical consequence.