T

Text Machine

Powerful text tools, in your browser

Baconian Cipher

Encode and decode Bacon's bilateral cipher, turning each letter into a group of five A and B symbols. Switch between the 24-letter and 26-letter alphabets, choose A/B or 0/1 symbols, follow along on the live code table, and copy, download, or share the result. Everything runs in your browser.

Cipher settings

Alphabet

Symbols

Classic Baconian uses 24 codes: I and J share one code, and U and V share one code, exactly as Bacon wrote it in 1605. A decoded J reads back as I, and a decoded V as U.

Plain text
Ciphertext

Enter text above to see the result here.

Baconian alphabet

A

AAAAA

B

AAAAB

C

AAABA

D

AAABB

E

AABAA

F

AABAB

G

AABBA

H

AABBB

IJ

ABAAA

K

ABAAB

L

ABABA

M

ABABB

N

ABBAA

O

ABBAB

P

ABBBA

Q

ABBBB

R

BAAAA

S

BAAAB

T

BAABA

UV

BAABB

W

BABAA

X

BABAB

Y

BABBA

Z

BABBB

How to use Baconian Cipher

  1. 1

    Choose encode or decode

    Pick Encode to turn plain text into Baconian groups, or Decode to turn groups of five A/B symbols back into letters.

  2. 2

    Pick the alphabet variant

    Choose the classic 24-letter alphabet, where I/J and U/V share a code, or the distinct 26-letter alphabet, where every letter is unique.

  3. 3

    Choose the symbols

    Show the code in Bacon's original A and B, or switch to 0 and 1 to see it as plain binary. Decoding accepts either style.

  4. 4

    Type or paste your text

    Enter your message and it is converted as you type. Encoding uses letters only, so spaces, digits, and punctuation are skipped.

  5. 5

    Copy, download, or share

    Copy the result, download it as a text file, or share a link that reopens the tool with your exact text, variant, and symbols ready to go.

Understanding the Baconian Cipher

What is the Baconian cipher?

The Baconian cipher, also called Bacon's cipher or the bilateral cipher, is a method of hiding a message that was devised by the English philosopher and statesman Sir Francis Bacon around 1605. Instead of replacing each letter with a single different letter, it replaces each letter with a group of five symbols drawn from just two letters — traditionally A and B. The word CAB, for example, becomes three five-symbol groups, one for C, one for A, and one for B.

What made Bacon's idea remarkable was not the code itself but how it could be hidden. Because every letter is spelled out using only two distinct symbols, those two symbols can be disguised as two slightly different typefaces in an ordinary-looking passage of text. A reader sees an innocent message; only someone who knows to sort the letters into two fonts can recover the five-symbol groups and read the secret. That makes Bacon's cipher one of the earliest systems of steganography — hiding the very existence of a message — as well as a cipher.

How Bacon's bilateral code works

To encode, each letter of the alphabet is given a fixed pattern of five symbols, each symbol being either A or B. Five positions, each holding one of two letters, give thirty-two possible patterns — more than enough for the twenty-six letters of the alphabet. A is written AAAAA, B is AAAAB, C is AAABA, and so on, counting upward in a steady two-symbol rhythm until Z. Spaces and punctuation have no pattern of their own, so encoding works on letters alone.

The two symbols carry no meaning by themselves; what matters is the pattern of five. This is why the scheme is called bilateral, meaning two-lettered: the whole alphabet is expressed with only an A and a B. The tool above shows the complete mapping in its alphabet table, and because each code is really a five-digit binary number in disguise, you can switch the display between A and B or 0 and 1 without changing anything about how it works.

The 24-letter and 26-letter variants

Bacon originally wrote his alphabet with twenty-four codes rather than twenty-six, because in the early seventeenth century the letters I and J were treated as one letter, as were U and V. In this classic version I and J share the code ABAAA and U and V share the code BAABB, so a decoded message may show an I where you wrote a J, or a U where you wrote a V.

The modern distinct version gives all twenty-six letters their own unique code, which removes that ambiguity and makes encoding and decoding perfectly reversible. The tool supports both: choose the classic 24-letter alphabet to match historical examples and old puzzles, or the distinct 26-letter alphabet when you want every letter to survive a round trip unchanged. The alphabet table updates to show exactly which codes the chosen variant uses.

Hiding a message in plain sight

The true cleverness of Bacon's cipher is steganographic: it lets you conceal a secret inside a longer, innocent-looking carrier message. Because each hidden letter needs five symbols, and each symbol can be represented by any letter written in one of two typefaces, you need five letters of carrier text for every one letter of the hidden message. Writing those five letters in a chosen mix of, say, a normal and an italic font spells out one five-symbol group.

Bacon called this principle omnia per omnia — anything by anything — because the carrier text can say whatever you like while secretly carrying a completely different message underneath. The two fonts need not be fonts at all: any binary distinction works, such as tall and short letters, or two different inks. This tool shows the codes openly rather than hiding them in type, which is what you want for learning, puzzles, and capture-the-flag challenges, but the underlying A/B groups are exactly what a steganographic version would conceal.

A worked Baconian example

Take the word HELLO and encode it with the distinct 26-letter alphabet. H is the eighth letter, which gives AABBB; E gives AABAA; L gives ABABB; L again gives ABABB; and O gives ABBBA. Strung together, HELLO becomes AABBB AABAA ABABB ABABB ABBBA — five groups of five symbols, one group per letter.

Reading it back is just as direct: split the symbols into groups of five and look each group up in the alphabet table. Because the same letter always produces the same group, the two L's in HELLO produce the same code twice, a small reminder that, like any simple substitution, Baconian text leaks the pattern of repeated letters. Switching the symbol style to 0 and 1 would show the very same message as 00111 00100 01011 01011 01110.

Decoding a Baconian cipher

To decode, you reverse the process: gather the symbols, divide them into groups of five, and translate each group back into its letter. Choose Decode above, pick the alphabet variant that was used to encode, and paste the ciphertext. The tool is forgiving about format — it reads A or B in either case, treats 0 as A and 1 as B so binary-style codes work too, and ignores spaces, slashes, and line breaks, so you can paste codes laid out however you found them.

Only complete groups of five are translated; a stray leftover symbol at the end is ignored, and any group that does not correspond to a letter is shown as a question mark so you can spot a transcription slip. If you are decoding with the classic 24-letter alphabet, remember that an original J comes back as I and an original V as U, because those letters shared a code in Bacon's day.

History and security of Bacon's cipher

Francis Bacon published his bilateral cipher in 1605 in The Advancement of Learning and described it more fully in the 1623 Latin edition. It later became famous far beyond cryptography: supporters of the theory that Bacon secretly wrote Shakespeare's plays spent decades hunting — unconvincingly — for Baconian ciphers hidden in the typography of the First Folio. The cipher's real legacy is conceptual, reducing the entire alphabet to a two-symbol code three centuries before computers did the same with binary.

By modern standards Bacon's cipher offers no cryptographic security. Once you recognise that a text is Baconian, decoding it is purely mechanical, because the five-symbol groups are a fixed substitution with no key. Its protection was always concealment — hiding that a message existed at all — rather than scrambling its contents. For genuinely protecting information today you should use a modern, peer-reviewed algorithm such as AES; keep Baconian for puzzles, teaching, and the pleasure of hiding words in plain sight.

Frequently asked questions

What is the Baconian cipher?
The Baconian cipher, or Bacon's cipher, is a method invented by Sir Francis Bacon around 1605 that replaces each letter with a group of five symbols taken from a two-letter alphabet, traditionally A and B. It is called a bilateral, or two-lettered, cipher. Its special feature is that the two symbols can be hidden in the typefaces of an ordinary text, concealing that a secret message exists at all.
How does the Baconian cipher work?
Every letter is assigned a fixed five-symbol code made of A's and B's — A is AAAAA, B is AAAAB, C is AAABA, and so on. To encode, you replace each letter of your message with its code; to decode, you split the symbols into groups of five and look each group up. Because five positions of two symbols give thirty-two combinations, there is a unique code for every letter of the alphabet.
Who invented the Baconian cipher?
It was created by Sir Francis Bacon, the English philosopher, scientist, and statesman, who described it around 1605 in The Advancement of Learning and in more detail in the 1623 Latin edition. Bacon called it a bilateral cipher and prized it for letting one message be hidden inside another — a principle he summed up as omnia per omnia, anything by anything.
What is the difference between the 24-letter and 26-letter versions?
In Bacon's original 24-letter alphabet, I and J share one code and U and V share another, because those pairs were treated as single letters in his time. The modern 26-letter version gives every letter its own unique code. Use the classic variant for historical examples and old puzzles; use the distinct variant when you need a message to survive encoding and decoding with every letter intact.
Why does Bacon's cipher use groups of five letters?
Five symbols, each of which can be one of two letters, produce thirty-two different patterns — two multiplied by itself five times. That is the smallest group size that yields enough patterns to cover all twenty-six letters of the alphabet, since four symbols would give only sixteen. The leftover patterns are simply unused, which is also why each code is really a five-digit binary number in disguise.
Can you show a worked Baconian example?
Using the distinct 26-letter alphabet, the word HELLO encodes to AABBB AABAA ABABB ABABB ABBBA — one five-symbol group per letter, where H is AABBB, E is AABAA, L is ABABB, and O is ABBBA. The same message in 0 and 1 symbols is 00111 00100 01011 01011 01110. To decode, you split the symbols back into groups of five and read each from the alphabet table.
How do you decode a Baconian cipher?
Gather the symbols, divide them into groups of five, and translate each group back into its letter using the same alphabet variant that encoded the message. In this tool, choose Decode, select the variant, and paste the ciphertext. It accepts A and B in any case, treats 0 as A and 1 as B, and ignores spaces and line breaks, so you can paste codes in almost any layout.
What does bilateral cipher mean?
Bilateral means two-lettered. Bacon used the word because his cipher expresses the whole alphabet with just two distinct symbols, an A and a B, arranged five at a time. It is the same idea that underlies binary code, where everything is represented with two digits, 0 and 1 — which is why this tool can display the very same message in A/B or in 0/1.
How is the Baconian cipher used for steganography?
Because each symbol is simply type one or type two, you can hide the A/B pattern inside an innocent carrier message by writing it in two slightly different forms — for example a normal and an italic typeface, or tall and short letters. Every five letters of carrier text encode one hidden letter. A casual reader sees only the ordinary message; the secret is revealed only by sorting the letters into the two forms.
Is the Baconian cipher the same as binary?
It is essentially five-bit binary. Each code is five positions, each holding one of two symbols, so A/B maps directly onto 0/1 and each letter corresponds to a five-digit binary number. Bacon devised this in 1605, more than three centuries before electronic computers used binary, which is why his cipher is often shown as an early ancestor of binary encoding. This tool lets you view the codes as A/B or as 0/1.
How secure is the Baconian cipher?
Not secure by modern standards. Once someone recognises that a text is Baconian, decoding it is purely mechanical, because the codes are a fixed substitution with no key. Its strength was never scrambling but concealment — hiding that a message existed at all by disguising the symbols in ordinary text. For real protection use a modern algorithm such as AES; Baconian is best kept for puzzles, learning, and capture-the-flag challenges.
Does the Baconian cipher keep spaces and punctuation?
No. Encoding works on the letters A to Z only, because spaces, digits, and punctuation have no five-symbol code of their own, so they are skipped. This means a decoded Baconian message comes back as a continuous run of letters without the original spacing. It is a normal feature of the cipher rather than a limitation of the tool.
Is my text uploaded to a server?
No. All encoding and decoding happens entirely in your browser, so your text is never uploaded, logged, or stored. Even a share link keeps your text and settings in the part of the URL after the hash, which browsers never send to a server, so your message stays private until you choose to share the link.

Related tools

Keep going with these handy tools

Caesar Cipher

Vigenère Cipher

Atbash Cipher

Rail Fence Cipher

Playfair Cipher

Affine Cipher