Baconian Cipher

Encode and decode messages with the Baconian cipher.

Result

aabbb aabaa ababa ababa abbab
Bacon's 24-letter table (as the ACA prints it): I and J share abaaa, U and V share baabb

How it is calculated

The Baconian cipher replaces each letter with a group of five symbols, a or b. The letter's position in the table, counted from 0, is written as a 5-bit binary number, with 0 as a and 1 as b. Bacon's 24-letter table (the default, as printed by the American Cryptogram Association) has no separate J or V: I and J are both abaaa, U and V both baabb, so K = abaab, W = babaa and Z = babbb. The 26-letter variant gives every letter its own code, A = 0 … Z = 25, so Z = bbaab. A to I are the same in both tables.

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, and in the 24-letter table J is written as I and V as U. 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 with no letter in the chosen table (above 23, or above 25 in the 26-letter variant) is dropped, and a leftover group shorter than five is ignored. In the 24-letter table the decoded text shows I for I or J and U for U or V.

Worked example

Encode Hello with Bacon's 24-letter table. Counting from A = 0 with J left out (it shares I's code): H is 7, which is 00111 in binary, so aabbb. E is 4, 00100, so aabaa. L is 10, 01010, so ababa, and it appears twice. O is 13, 01101, so abbab. Joined with spaces the result is aabbb aabaa ababa ababa abbab. In the 26-letter variant L is 11 and O is 14, giving aabbb aabaa ababb ababb abbba.

Try this example →

Common mistakes

  • Decoding with the wrong table. From J onward the 24-letter and 26-letter tables give different codes, so a message written in one comes out with wrong letters in the other.
  • Expecting J or V back after decoding Bacon's table. They share codes with I and U, so read I as I or J and U as U or V.
  • Counting the alphabet from 1 instead of 0. A must be aaaaa, not aaaab, or every letter shifts by one.
  • 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.

Sources

About this calculator

This tool encrypts or decrypts text with the Baconian cipher, devised by Sir Francis Bacon, which writes each letter as a 5-character sequence of "a" and "b" (in effect a 5-bit binary code, e.g. A = aaaaa, B = aaaab). Bacon's own table has 24 letters: I and J share one code (abaaa), as do U and V (baabb). That is the table the American Cryptogram Association prints, and the tool uses it by default; a 26-letter variant that gives every letter its own code (A = 0 … Z = 25 in binary) can be chosen instead. From J onward the two tables give different codes, so decode a message with the table it was written in. 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. The tool works in both directions, turning text into a/b groups and a/b or two-symbol sequences back into letters.

Was this helpful?

You can pick up to 3 reactions.

Note from the editors

This tool now offers two tables. The default is Bacon's own 24-letter one, as the American Cryptogram Association prints it. From the letter J on the two tables differ, so pick the one the message was written in. Digits, punctuation and non-English letters like ş are skipped when encoding. Jack comes out as abaaa aaaaa aaaba abaab in the default table, so its first group is also the code for I. Have a puzzle that fails? Paste it.

Comments

  • Be the first to comment.

Popular calculators

All Calculators