Baconian Cipher

Encode and decode messages with the Baconian cipher.

How it is calculated

The Baconian cipher replaces each letter with a group of five symbols, a or b. In this 26-letter version the letter's position in the alphabet counted from 0 (A = 0, B = 1 … Z = 25) is written as a 5-bit binary number, with 0 as a and 1 as b. So A = aaaaa, B = aaaab and Z = bbaab.

When encoding, the text is made uppercase, letters within a word are separated by one space and words by two spaces; digits, punctuation and accented letters are skipped. When decoding, only a and b (any case) are read, everything else is ignored, and the symbols are cut into groups of five from the start. A group whose value is above 25 is dropped, and a leftover group shorter than five is ignored. The original I/J and U/V merged variant is not used.

Worked example

Encode Hello. H is letter number 7, which is 00111 in binary, so aabbb. E is 4, 00100, so aabaa. L is 11, 01011, so ababb, and it appears twice. O is 14, 01110, so abbba. Joined with spaces the result is aabbb aabaa ababb ababb abbba.

Try this example →

Common mistakes

  • Counting the alphabet from 1 instead of 0. A must be aaaaa, not aaaab, or every letter shifts by one.
  • Decoding text that uses the historic 24-letter table, where I/J and U/V share a code. Those messages will decode with some wrong letters here.
  • Breaking the a/b string into groups of the wrong size or dropping one symbol; every later letter is then misread.
  • Expecting digits or punctuation to be encoded. They are skipped, so they vanish from the message.

About this calculator

This tool encrypts or decrypts text with the Baconian cipher, devised by Sir Francis Bacon, which represents each letter as a unique 5-character sequence of "a" and "b" (essentially a 5-bit binary code, e.g. A = aaaaa, B = aaaab). Its original power was as a steganographic device: the a/b sequence could be hidden in an innocuous cover text using two subtly different typefaces or formats, so the message stayed invisible unless you knew to look.

Cryptography students and puzzle designers use it today to explore early binary encoding and steganography, and to hide messages inside seemingly ordinary text. Enter your text to encode it into a/b groups, or paste a/b (or two-symbol) sequences to decode them back to letters.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators