decoder.tools

Baconian Cipher Decoder

Decode Bacon's cipher: groups of five A/B letters, each standing for one letter.

INPUT
OUTPUT

The result appears here as you type.

Decoding runs in your browser. What you paste is not sent to a server.

The Baconian cipher writes each letter as a group of five symbols, each either A or B, like a 5-bit binary code. A Baconian decoder reads the groups of five and converts each to its letter.

Example

Input
AABBB AABAA ABABB ABABB ABBBA
Output
HELLO

Spaces are optional. Anything other than A and B is ignored, so you can also paste a long run like AABBBAABAA….

How the Baconian cipher works

Francis Bacon described the cipher in 1605. Each letter becomes five A/B symbols. Reading A as 0 and B as 1, the groups count up from AAAAA like binary numbers.

This tool uses the 26-letter version, where every letter has its own code:

LetterCodeLetterCodeLetterCode
AAAAAAJABAABSBAABA
BAAAABKABABATBAABB
CAAABALABABBUBABAA
DAAABBMABBAAVBABAB
EAABAANABBABWBABBA
FAABABOABBBAXBABBB
GAABBAPABBBBYBBAAA
HAABBBQBAAAAZBBAAB
IABAAARBAAAB

Bacon's original 24-letter version used the same code for I and J and for U and V, so from J onward its codes are one step lower than the table above. If the output is close but slightly off from J onward, the message uses the 24-letter alphabet.

Hidden in plain sight

Bacon's real idea was steganography. The A and B don't have to be letters: they can be any two-way difference, such as two fonts, bold and normal, upper and lower case, or two kinds of object in a picture. A harmless sentence printed in two typefaces can carry a secret message, one hidden bit per letter.

To decode one of those, write each character as A or B according to its style, then paste the result here.

How to use the Baconian decoder

  1. Convert the message to A and B if it uses other symbols: for example, 0/1, two fonts or upper and lower case.
  2. Paste the A/B text. Groups of five are read left to right.
  3. If the result is off from J onward, the original used the 24-letter alphabet.

Decode in code

Python
msg = "AABBB AABAA ABABB ABABB ABBBA".replace(" ", "")
print("".join(chr(65 + int(msg[i:i + 5].replace("A", "0").replace("B", "1"), 2)) for i in range(0, len(msg), 5)))

At a glance

InventedFrancis Bacon, 1605
Code length5 symbols per letter
Alphabets24-letter (I=J, U=V) and 26-letter
This tool26-letter alphabet

Frequently asked questions

Is the Baconian cipher binary?

In effect, yes. Each group is a 5-bit number with A = 0 and B = 1, in the 26-letter version. It predates modern binary by centuries but uses the same idea.

My message uses 0 and 1, not A and B. Will it work?

Replace 0 with A and 1 with B first. If the groups are 8 digits long instead of 5, it's probably ordinary binary text.

How do I spot a Baconian message?

Look for text that alternates between exactly two styles (two fonts, bold and normal, or random-looking capitalization), or for runs of only two symbols whose length is a multiple of five.

Last reviewed · found a mistake? contact@decoder.tools · view as markdown