Cipher

Bacon Cipher Encoder and Decoder

The Bacon cipher, or Baconian cipher, spells each letter as a unique five-symbol sequence of A and B. Type your text to see its biliteral code, or paste a sequence of A's and B's to read the hidden letters back.

bacon-cipher.decode
Text
Bacon code

Result appears here

It was designed to be hidden inside ordinary-looking writing using two subtly different letterforms, not just to look like a code on its own. Everything runs in your browser.

How the Bacon Cipher works

Each letter is assigned a number from its position in the alphabet (A is 0, Z is 25), written as a 5-digit binary number, then each 0 is shown as A and each 1 as B. Five symbols are enough because two to the fifth power is 32, comfortably covering 26 letters.

To decode, take each group of five A's and B's, turn A back into 0 and B into 1, read the result as a binary number, and count that many places into the alphabet starting from A.

Examples

HI
AABBB ABAAA
SECRET
BAABA AABAA AAABA BAAAB AABAA BAABB
Each block of five A/B symbols is one letter.
AABBB ABAAA (decode)
hi

History and origins

Sir Francis Bacon devised the cipher around 1605 as a form of steganography: the real secret was not the A/B pattern itself but the idea of a binary code hidden inside plain text, using two visually distinct typefaces to stand for A and B. His original table used only 24 codes, sharing one code between I and J and another between U and V.

This translator uses the modern 26-letter version, where every letter from A to Z gets its own unique five-symbol code, so nothing is merged and every message decodes back exactly. It is a fitting historical footnote that Bacon's biliteral idea, spelling letters as 5-bit binary values, predates the same principle inside every modern computer by three centuries.

Frequently asked questions

Does this use Francis Bacon's original 24-letter table?

No. The original 1605 table merges I with J and U with V. This translator uses the widely used 26-letter extension, so every letter has its own unique code and nothing is lost when you decode.

Why five letters, A or B, per character?

Five binary digits can represent 32 different values, which comfortably covers all 26 letters of the alphabet with a few codes to spare.

Was the Bacon cipher meant to be seen?

Not originally. Bacon's method hid the A/B pattern inside two nearly identical typefaces in an ordinary-looking cover text, so a message could pass as innocent writing. This tool shows the A/B code directly rather than the hidden typeface version.

Learn more

Go deeper on the ideas behind this tool.

Related translators