Skip to content
Also from us: TypologyOnline.com · Free personality tests

Simple Bacon's Cipher: Turning Letters into A/B Patterns

How Francis Bacon's five-symbol alphabet turned messages into binary-looking groups, and why the real trick was not the A and B, but how they could be hidden.

Try the Simple Bacon's Cipher tool
Illustration of Simple Bacon cipher letters turning into five-symbol A and B groups
Simple Bacon's Cipher turns letters into fixed-width A/B groups, revealing the pattern before the deeper steganographic trick.

Simple Bacon's Cipher looks strange before it looks clever. A normal word disappears into groups of five letters: HELLO becomes AABBB AABAA ABABA ABABA ABBAB.

At first glance, it feels like a code made from only two symbols: A and B. That is exactly the point. Bacon's Cipher, also called the Baconian Cipher or biliteral cipher, represents every letter using a five-character pattern made from two possible signs.

In the simple educational version, those signs are written directly as A and B. Every plaintext letter becomes a group like AAAAA, ABABA, or BABBB. That makes Bacon's Cipher feel surprisingly modern, because it reduces letters to fixed-width patterns made from two possible states.

It is not modern encryption, and it should not be used for secrecy today. But the underlying idea is powerful: take information, reduce it to two possible signs, group those signs into fixed-length units, and then read the units back as symbols.

The simple version on CipherRegister shows the pattern openly. It turns letters into visible A/B groups and back again. The deeper historical Baconian idea is more subtle: those A/B choices can be hidden inside another piece of writing by using two different typefaces, cases, colours, or visual styles.

The visible A/B groups teach the mechanism. The hidden A/B pattern reveals the real idea.

Simple Bacon's Cipher at a glance

Feature Simple Bacon's Cipher
Type Fixed-width alphabet encoding / biliteral cipher
Family Baconian
Main idea Encode each letter as a five-character A/B group
Alphabet Classical 24-letter Bacon alphabet
Symbols A and B
Letter width 5 symbols per letter
Historical merges J is treated as I; V is treated as U
A AAAAA
Z BABBB
Example HELLO WORLD -> AABBB AABAA ABABA ABABA ABBAB BABAA ABBAB BAAAA ABABA AAABB
Secret key None in the simple visible version
Decryption Split the A/B stream into groups of five and map each group back to a letter
Security Not secure as visible A/B text
Best use Learning fixed-width encoding, binary-like representation, historical ciphers, and steganography basics

The version described here is the simple educational form: it writes the A/B groups directly.

That is the right place to start. Before you can understand how Baconian steganography hides a message, you need to understand the A/B alphabet itself.

What is Simple Bacon's Cipher?

Simple Bacon's Cipher is a system that replaces each plaintext letter with a group of five A/B symbols.

Plain letter Bacon group
A AAAAA
B AAAAB
C AAABA
D AAABB
E AABAA

Each output group has exactly five characters. That matters. If the groups are not complete, the decoder cannot reliably read the message.

A stream like:

AABBBAABAAABABA

only makes sense when it is split correctly:

AABBB AABAA ABABA

That gives:

HEL

The simple CipherRegister tool uses the classical 24-letter Bacon alphabet. In this historical form, I/J share one position, and U/V share one position.

So J is treated as I, and V is treated as U. A word such as JULIUS is encoded as if it were IULIUS, and a word such as VALUE is encoded as if it were UALUE.

This can feel odd to modern readers, but it belongs to the older alphabet convention behind the classical Baconian system.

How does Simple Bacon's Cipher work?

Simple Bacon's Cipher works by giving each letter a five-symbol A/B pattern. The classical 24-letter Bacon alphabet is:

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

To encrypt, replace each plaintext letter with its five-character group. To decrypt, split the A/B stream into groups of five and look each group up in reverse.

So:

H -> AABBB
E -> AABAA
L -> ABABA
L -> ABABA
O -> ABBAB

and:

HELLO -> AABBB AABAA ABABA ABABA ABBAB

Key and rules

The simple visible version has no secret key. Its "key" is really the shared Bacon alphabet.

Rule Explanation
Use A and B symbols Each letter becomes a pattern made from two signs
Use five symbols per letter Every plaintext letter becomes one fixed-width group
Use the classical 24-letter alphabet I/J share one group and U/V share one group
Group output for readability Spaces between groups help the reader decode
Decode in chunks of five The A/B stream must be split into complete groups
Non-A/B characters may be ignored Spaces and separators can be formatting only
Not encryption Visible A/B groups are easy to decode if the table is known

The fixed width is the part to notice. Each letter always consumes exactly five A/B positions.

That makes Bacon's Cipher a useful bridge between historical ciphers and binary-like representation.

Worked example: HELLO WORLD

Now encode:

HELLO WORLD

using the classical 24-letter Bacon alphabet.

First, write the plaintext letters:

H E L L O W O R L D

Now look up each letter:

Plain letter Bacon group
H AABBB
E AABAA
L ABABA
L ABABA
O ABBAB
W BABAA
O ABBAB
R BAAAA
L ABABA
D AAABB

Put the groups together:

HELLO WORLD -> AABBB AABAA ABABA ABABA ABBAB BABAA ABBAB BAAAA ABABA AAABB

If the output is written without spaces, it becomes:

AABBBAABAAABABAABABAABBABBABAAABBABBAAAAABABAAAABB

That is the same message, but harder to read by eye. The groups are still five symbols long.

Why five symbols?

Each position in a Bacon group has two possible values:

A or B

With five positions, the number of possible patterns is:

2 x 2 x 2 x 2 x 2 = 32

So five A/B positions can represent up to 32 different symbols. That is enough for the classical 24-letter Bacon alphabet.

This is why Bacon's Cipher feels binary-like. It uses two possible signs, grouped into fixed-width units.

It is not the same as modern binary bytes, but the conceptual family resemblance is easy to see.

J and V in the classical alphabet

The classical Bacon alphabet has 24 letter positions rather than 26. It combines:

I/J
U/V

That means:

Modern letter Classical handling
I I/J group
J I/J group
U U/V group
V U/V group

For example:

JULIUS

is normalised as:

IULIUS

and:

VALUE

is normalised as:

UALUE

This is not an error. It is part of the classical alphabet convention.

Using the CipherRegister Simple Bacon's Cipher tool

The Simple Bacon's Cipher tool focuses on the visible educational version.

Control What it does
Encode Converts plaintext letters into five-character A/B groups
Decode Converts A/B groups back into plaintext
Group output Keeps the five-symbol chunks readable
Preserve punctuation Leaves punctuation visible when useful
Classical alphabet Uses the 24-letter I/J and U/V merged alphabet
Load example Starts with HELLO WORLD

This tool is deliberately simple. It shows the A/B alphabet directly before moving into the more subtle steganographic possibilities.

Simple Bacon vs Advanced Bacon

CipherRegister has two Bacon tools because the simple and advanced ideas teach different things.

Feature Simple Bacon Advanced Bacon
Main focus Visible A/B groups Flexible Baconian encoding and hiding
Alphabet Classical 24-letter alphabet Can support richer variants
Symbols A and B Custom symbol pairs may be used
Steganography Explained conceptually Explored more directly
Best first use Learn the table Experiment with concealment

Simple Bacon teaches the alphabet. Advanced Bacon explores the concealment idea.

Bacon's Cipher and steganography

The visible A/B version is only the start. The more interesting Baconian idea is that A and B do not need to be literal letters.

They can be represented by two different features:

A-type mark B-type mark
normal text italic text
lowercase uppercase
black text grey text
one font another font
thin stroke thick stroke

That means a cover message can carry a hidden message in its formatting. The visible text says one thing, while the pattern of styles carries another.

This is why Bacon's Cipher is often discussed as steganography. It can hide the existence of the secret message, not merely encode the secret message directly.

Weaknesses

Simple Bacon's Cipher is not secure when written as visible A/B groups.

Weakness Why it matters
No secret key The simple visible version has no private key
Fixed table Each letter always maps to the same group
Easy recognition A/B groups of length five are a strong clue
24-letter ambiguity I/J and U/V share positions
Grouping matters Missing or extra A/B symbols break decoding
Not modern encryption It lacks authentication, randomness, and secure keys

The simple visible form is best treated as an encoding and teaching tool. The steganographic form is more interesting, but still not modern cryptography.

How Simple Bacon's Cipher is broken

If the output is visible as A/B groups, breaking it is straightforward.

An attacker only needs to split the stream into groups of five:

AABBB AABAA ABABA

Then they look up each group:

AABBB = H
AABAA = E
ABABA = L

So:

AABBB AABAA ABABA -> HEL

There is no key to recover. The challenge is only recognising the system and grouping the symbols correctly.

In a steganographic Baconian message, the attack is different. The attacker must first notice that two visual styles are being used to carry an A/B pattern. Once that pattern is extracted, the decoding is simple.

Cipher or encoding Relationship
Advanced Bacon's Cipher Extends the idea with custom symbols and steganographic patterns
Binary Also uses two possible states, though for modern data representation
Base32 Uses fixed-size bit groupings in a modern encoding context
A1Z26 Another simple letter-to-code representation
Morse code Represents letters as patterns of two signal types
Tap Code Turns letters into countable physical signals

Simple Bacon is a useful bridge between classical ciphers, encodings, and binary-style representation.

A simple Python Bacon encoder

Simple Bacon's Cipher is a good programming exercise because the code is mostly a table lookup. The script below can encode plaintext into classical 24-letter Bacon groups, treat J as I, treat V as U, and decode A/B groups back into plaintext.

Python exampleShow code
BACON_ALPHABET = {
    "A": "AAAAA",
    "B": "AAAAB",
    "C": "AAABA",
    "D": "AAABB",
    "E": "AABAA",
    "F": "AABAB",
    "G": "AABBA",
    "H": "AABBB",
    "I": "ABAAA",
    "K": "ABAAB",
    "L": "ABABA",
    "M": "ABABB",
    "N": "ABBAA",
    "O": "ABBAB",
    "P": "ABBBA",
    "Q": "ABBBB",
    "R": "BAAAA",
    "S": "BAAAB",
    "T": "BAABA",
    "U": "BAABB",
    "W": "BABAA",
    "X": "BABAB",
    "Y": "BABBA",
    "Z": "BABBB",
}

DECODE_ALPHABET = {group: letter for letter, group in BACON_ALPHABET.items()}


def normalise_plain_letter(char):
    """
    Convert input letters to the classical 24-letter Bacon alphabet.
    J is treated as I.
    V is treated as U.
    """
    char = char.upper()

    if char == "J":
        return "I"

    if char == "V":
        return "U"

    return char


def encode_bacon(text, keep_punctuation=True, group_output=True):
    """
    Encode plaintext into five-character A/B Bacon groups.
    """
    output = []

    for char in text:
        if char.isalpha():
            normalised = normalise_plain_letter(char)
            output.append(BACON_ALPHABET[normalised])
        elif keep_punctuation and not char.isspace():
            output.append(char)

    if group_output:
        return " ".join(output)

    return "".join(output)


def decode_bacon(encoded_text):
    """
    Decode A/B Bacon groups back into plaintext.

    Non-A/B characters are ignored, so the function can decode
    grouped or ungrouped A/B streams.
    """
    stream = ""

    for char in encoded_text.upper():
        if char in "AB":
            stream += char

    if len(stream) % 5 != 0:
        raise ValueError("Bacon input must contain complete groups of five A/B symbols.")

    output = []

    for index in range(0, len(stream), 5):
        group = stream[index:index + 5]
        output.append(DECODE_ALPHABET.get(group, "?"))

    return "".join(output)


# Example
plaintext = "HELLO WORLD"

encoded = encode_bacon(plaintext)
decoded = decode_bacon(encoded)

print("Plaintext :", plaintext)
print("Encoded   :", encoded)
print("Decoded   :", decoded)

Expected output:

Plaintext : HELLO WORLD
Encoded   : AABBB AABAA ABABA ABABA ABBAB BABAA ABBAB BAAAA ABABA AAABB
Decoded   : HELLOWORLD

The most important object in the code is the table:

BACON_ALPHABET = {
    "A": "AAAAA",
    "B": "AAAAB",
    "C": "AAABA",
}

The cipher is mostly a reversible lookup between plaintext letters and five-symbol A/B groups.

Common questions about Simple Bacon's Cipher

Is Simple Bacon's Cipher secure?

No. The simple visible version is not secure. If the output is written as A/B groups, anyone who knows the Bacon alphabet can decode it.

The more interesting Baconian idea is steganographic: the A/B pattern can be hidden inside another text using two fonts, two cases, two colours, two styles, or another pair of visible differences.

Why does each letter use five A/B symbols?

Because five positions with two choices each gives:

2^5 = 32

possible patterns. That is enough to represent the classical 24-letter Bacon alphabet.

Why are J and V changed?

The classical 24-letter Bacon alphabet combines I/J and U/V. So J is treated as I, and V is treated as U.

This reflects an older alphabet convention and keeps the table to 24 letter positions.

What does AAAAA mean?

In the classical Bacon alphabet:

AAAAA = A

It is the first pattern in the table.

What does BABBB mean?

In the classical Bacon alphabet:

BABBB = Z

It is the final pattern used in the 24-letter version.

What is the difference between Simple Bacon and Advanced Bacon?

Simple Bacon writes the A/B groups directly. Advanced Bacon can use richer variants, including custom A/B symbols, 24-letter or 26-letter alphabets, hidden case-based patterns, and steganographic disguising.

Is Bacon's Cipher the same as binary?

No. But it has a binary-like structure. Binary uses two symbols, usually 0 and 1. Simple Bacon uses two symbols, A and B.

Each Bacon letter is a group of five A/B choices, which is why it feels similar to a five-bit encoding. But Bacon's Cipher is a historical alphabet encoding and steganographic method, not modern binary data encoding.

Why Simple Bacon's Cipher still matters

Simple Bacon's Cipher should not be used to protect anything serious. Not passwords. Not private messages. Not financial information. Not API keys. Not personal data. Not recovery phrases.

The visible A/B version is far too easy to decode. It has no secret key, no modern security, and no protection against anyone who recognises the pattern.

But it still earns its place.

It shows how letters can become fixed-width symbol groups. It shows how two simple signs can represent a whole alphabet. It shows why grouping matters. It shows how historical alphabet conventions treated I/J and U/V differently. It shows how encoding and steganography can overlap.

And it shows one of the most important ideas in hidden communication: the carrier does not have to look like the message.

A and B can be letters. But they can also be fonts, colours, cases, shapes, or any pair of differences that sender and receiver agree to notice.

That is the real lesson of Bacon's Cipher. Simple Bacon turns letters into A/B patterns, but the deeper Baconian idea hides the A/B pattern inside something ordinary.

That is why Bacon's Cipher still matters. Not because visible A/B groups are strong. Because it teaches how a message can live underneath another message.

Try the Simple Bacon's Cipher tool

Open the Simple Bacon's Cipher tool and try:

HELLO WORLD

You should get:

AABBB AABAA ABABA ABABA ABBAB BABAA ABBAB BAAAA ABABA AAABB

Then try words containing J or V, such as:

JULIUS
VALUE

You will see how the classical 24-letter Bacon alphabet treats J as I and V as U.

Sources and further reading

Try the Simple Bacon's Cipher Tool

Want to experiment with the idea in practice? Open the matching tool and try your own text.

Open Simple Bacon's Cipher
Signal acquired

A note from the team

We build these tools because we love cryptography, encoding, and making difficult ideas easier to explore. If they've helped you, even a small coffee means the world to the project. Thank you!

Say thanks on Ko-fi

Read next

Signalling Ciphers Tap Code Cipher: When Letters Became Knocks How a 5×5 square turned the alphabet into row-and-column tap groups, and made communication possible through walls, pipes, floors, and silence. Letter-Number Encoding A1Z26 Cipher: The Mechanics of Simple Substitution How replacing letters with their alphabet positions teaches symbolic transformation, reversibility, and the limits of simple secrecy. Binary-to-Text Encoding Base32: The Encoding That Makes Binary Easier to Read, Copy, and Survive How a 5-bit alphabet became a quiet helper in authenticator apps, DNS-safe strings, recovery codes, identifiers, and text-shaped software systems.
Back to all articles