# Baconian Cipher Decoder

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

- Page: https://decoder.tools/baconian-cipher-decoder
- Category: Classical & Obfuscated Ciphers
- Status: live, runs in the browser
- Last reviewed: 2026-10-23

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

```text Input
AABBB AABAA ABABB ABABB ABBBA
```

```text 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:

| Letter | Code | Letter | Code | Letter | Code |
|---|---|---|---|---|---|
| A | AAAAA | J | ABAAB | S | BAABA |
| B | AAAAB | K | ABABA | T | BAABB |
| C | AAABA | L | ABABB | U | BABAA |
| D | AAABB | M | ABBAA | V | BABAB |
| E | AABAA | N | ABBAB | W | BABBA |
| F | AABAB | O | ABBBA | X | BABBB |
| G | AABBA | P | ABBBB | Y | BBAAA |
| H | AABBB | Q | BAAAA | Z | BBAAB |
| I | ABAAA | R | BAAAB | | |

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 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

| | |
|---|---|
| Invented | Francis Bacon, 1605 |
| Code length | 5 symbols per letter |
| Alphabets | 24-letter (I=J, U=V) and 26-letter |
| This tool | 26-letter alphabet |

## FAQ

### 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](/binary-to-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.
