Converters & translators

Bacon Cipher Decoder & Encoder

Encode and decode the Bacon (Baconian) cipher, which writes each letter as five A/B symbols, with both alphabets and how to hide and find secret messages.

Updated · Free, no sign-up

Encoded
AABBB AABAA ABABB ABABB ABBBA

Share this tool

Know someone who’d love it?

What is the Bacon cipher?

The Bacon cipher, also called the Baconian cipher or the biliteral cipher, writes every letter as a group of five symbols that come in only two kinds, usually shown as A and B. H, for example, is AABBB. The English philosopher and statesman Francis Bacon described it in 1605.

What makes it special is not the code but where you can put it. Because any two kinds of thing can stand for A and B, a Bacon message can hide inside an ordinary sentence: in two typefaces, in capitals and small letters, in bold and plain text, even in a row of coins showing heads or tails. A reader who does not know to look sees only the sentence. Hiding the fact that a message exists at all is called steganography, and the Bacon cipher is its best-known example.

How to use the Bacon cipher encoder and decoder

  1. Choose Encode to turn text into A/B groups, or Decode to turn groups back into letters.
  2. To decode, paste the groups. Zeros and ones work as well as A and B, and spaces between the groups are optional: the decoder reads the symbols five at a time.
  3. Tap Copy to save the result. The lookup table in the tool shows which group became which letter.

If your message is hidden in a sentence rather than written as A and B, first turn it into A/B: write A for every letter of one kind and B for every letter of the other (the section on solving below shows how). If you are holding a string of symbols and are not sure it is Bacon at all, the tool’s cipher helper can suggest which code it looks like.

Bacon cipher alphabet chart

The Bacon alphabet: every letter is five As and Bs, which can hide in any text.

Bacon cipher alphabet: the 26-letter and 24-letter tables

There are two Bacon alphabets, and puzzles use both. Bacon’s original table has 24 codes because, in his day, I and J were treated as one letter and so were U and V. The modern table gives all 26 letters their own code. Up to I the two are identical; after that they drift apart by one code, and after U by two. The tool encodes with the 26-letter alphabet. The binary column shows the same 26-letter code as zeros and ones.

Bacon cipher alphabet: each letter with its 26-letter code, its 24-letter code and the binary form
Letter26-letter code24-letter codeBinary (26)
AAAAAAAAAAA00000
BAAAABAAAAB00001
CAAABAAAABA00010
DAAABBAAABB00011
EAABAAAABAA00100
FAABABAABAB00101
GAABBAAABBA00110
HAABBBAABBB00111
IABAAAABAAA01000
JABAABABAAA *01001
KABABAABAAB01010
LABABBABABA01011
MABBAAABABB01100
NABBABABBAA01101
OABBBAABBAB01110
PABBBBABBBA01111
QBAAAAABBBB10000
RBAAABBAAAA10001
SBAABABAAAB10010
TBAABBBAABA10011
UBABAABAABB10100
VBABABBAABB *10101
WBABBABABAA10110
XBABBBBABAB10111
YBBAAABABBA11000
ZBBAABBABBB11001

* In the 24-letter table, J and V share the code of the letter before them, so ABAAA means I or J and BAABB means U or V. Read the word from context.

Five symbols of two kinds give 2 × 2 × 2 × 2 × 2 = 32 possible groups. The 26-letter alphabet uses the first 26 and leaves 6 unused, so a group from the end of the range, such as BBBBB, does not stand for any letter.

How to encode the Bacon cipher by hand

Bacon’s alphabet is the binary numbers from 0 to 25 with A for 0 and B for 1. So you can rebuild the table anywhere: number the letters from A = 0, write the number in five binary digits, and swap the digits for letters. Encoding SECRET:

Encoding SECRET with the 26-letter Bacon alphabet
LetterNumber (A=0)BinaryBacon
S1810010BAABA
E400100AABAA
C200010AAABA
R1710001BAAAB
E400100AABAA
T1910011BAABB

So SECRET is BAABA AABAA AAABA BAAAB AABAA BAABB. You can stop there and send the groups as they are, or go one step further and hide them.

How to hide a message with the Bacon cipher

  1. Encode your secret. Every secret letter needs five letters of cover text.
  2. Write a harmless sentence with at least that many letters. YES has 3 letters, so it needs 15, and “Bake a cake at noon” has exactly 15.
  3. Go through the cover letters one by one. Where the code says A, write the letter in your first style; where it says B, use the second style. Here, A is a small letter and B is a capital.

The secret YES is BBAAA AABAA BAABA, and the sentence becomes:

BAke a caKe aT noOn

On paper or in a document, capitals are too easy to spot. Bacon’s own idea was two slightly different typefaces, and the same trick works with bold and regular letters, italic and upright, two colors of ink, or letters with and without a tiny dot. Outside writing, anything with two states can carry the code: beads on a string, light switches, cups turned up or down, short and long knocks.

How to solve a Baconian cipher

  1. Find the two kinds. Look for something that comes in exactly two versions: A and B, 0 and 1, two fonts, capitals and small letters, or two kinds of object.
  2. Write it as A and B and split it into groups of five. The total should be a multiple of five (extra symbols at the end are padding).
  3. Decode with the 26-letter table. Paste the groups into the tool, or look them up in the table above.
  4. If it is nonsense, swap A and B. Nothing says which style means A. HI encoded with the two styles the wrong way round reads BBAAA BABBB, which decodes to nothing useful until you swap the letters back.
  5. If it goes wrong after I, try the 24-letter table. YOU written in the original alphabet and decoded with the modern one comes out as WNT: every letter after I lands one or two places too early. Shift those letters forward and the word appears.

For the hidden sentence above, reading capitals as B and small letters as A gives BBAAA AABAA BAABA, which decodes to YES.

Baconian cipher practice puzzles

Three puzzles to try, from easy to hard. Solve them by hand with the table, then check your answer with the decoder.

Puzzle 1 (Easy)

Standard A/B groups, 26-letter alphabet.

AAABA ABBBA AAABB AABAA

Show the answer

CODE

Puzzle 2 (Medium)

Zeros and ones with the spaces removed. Split it into groups of five first.

0000100000000100111001101

Show the answer

BACON

Puzzle 3 (Hard)

The message is hidden in the capital letters of an ordinary greeting.

heLLo tHERe

Show the answer

GO

History of the Bacon cipher

Francis Bacon (1561 to 1626) wrote about ciphers in The Advancement of Learning, published in 1605, and his cipher is usually dated to that year. He set it out in full, with his “biliteral alphabet” printed as a plate, in the expanded Latin version of that book, De Augmentis Scientiarum, in 1623. His point was the one that still makes the cipher interesting: with two slightly different typefaces, a printed text can carry a second message that nobody notices.

That idea later sent many readers hunting for secret Bacon messages in old books, above all in the plays of Shakespeare, as supposed proof that Bacon wrote them. The cryptologists William and Elizebeth Friedman, who had started their careers studying exactly those claims, examined them in their 1957 book The Shakespearean Ciphers Examined and showed that none of the supposed hidden messages stood up.

Bacon cipher and binary

Bacon’s alphabet is a five-bit binary code, written down more than three centuries before the first computers. Modern computers use the same idea with more digits: in ASCII, the letter H is 01001000, eight bits instead of five, so that capitals, small letters, digits and punctuation all fit. If your puzzle has groups of eight zeros and ones rather than five, it is probably ordinary computer text: try the binary translator instead.

Where the Bacon cipher is used

  • Escape rooms: a shelf of books with some spines turned the wrong way, a string of light and dark beads, or a sign with two fonts. Players who spot the pattern and count in fives get the code.
  • Classrooms: it is a gentle first look at binary numbers, and hiding a message in a sentence makes the difference between hiding and scrambling a message easy to see.
  • Puzzle contests: cipher events at school competitions often include Baconian puzzles, where the message hides in a sentence and solvers have to work out which letters are A and which are B.
  • Layered puzzles: the letters that come out of a Bacon cipher can be scrambled by a second cipher such as a Caesar shift, or spell out the next clue, for example a set of numbers to read with A1Z26.

Two other codes that turn letters into simple signals are Morse code, with its dots and dashes, and the tap code, which spells letters with knocks.

Free and private

This Bacon cipher tool runs entirely in your browser. It is free, needs no sign-up, and nothing you type is uploaded or stored.

For teachers, bloggers & clubs

Put the Bacon Cipher on your website

Give your readers this tool right on your page. Copy the code, paste it into your site, done: no sign-up, no account.

  • Free for any website
  • No ads, no cookies
  • Fits phones and sidebars
  • Always up to date
See it live ↗

Please keep the small credit line under the tool; you may add rel="nofollow" to its link. How it works & the rules

› Show the code

Frequently asked questions

What is the Bacon cipher?
The Bacon or Baconian cipher writes every letter as a group of five symbols of two kinds, usually A and B. H, for example, is AABBB. Because any two styles can stand for A and B, the code can be hidden inside ordinary text.
How do I decode a Baconian cipher?
Turn the message into A and B, split it into groups of five and look each group up in the Bacon alphabet. In the tool, choose Decode and paste the groups; 0 and 1 work as well as A and B.
What is the Baconian cipher key?
There is no secret key: the key is the Bacon alphabet itself, A = AAAAA, B = AAAAB and so on, which is the numbers 0 to 25 in five binary digits with A for 0 and B for 1.
What is the difference between the 24-letter and 26-letter Bacon alphabets?
Bacon's original 24-letter table gives I and J one code and U and V one code. The modern 26-letter table gives every letter its own code. The two agree up to I and then differ by one code, and by two after U.
How do you hide a message with the Bacon cipher?
Encode the secret, then write a cover sentence with five letters for every secret letter. Write each cover letter in one style for A and another for B, such as small letters and capitals, plain and bold, or two typefaces.
How do I solve a hidden Baconian cipher?
Look for something that comes in exactly two versions, write one as A and the other as B, and decode in groups of five. If you get nonsense, swap A and B; if it goes wrong only after I, try the 24-letter alphabet.
Who invented the Bacon cipher?
The English philosopher and statesman Francis Bacon. It is usually dated to 1605, when he wrote about ciphers in The Advancement of Learning, and he set out the full alphabet in De Augmentis Scientiarum in 1623.
Is the Bacon cipher binary?
Yes, in effect. Each letter is a five-bit binary number with A for 0 and B for 1, which gives 32 possible groups for 26 letters. Computer text uses eight bits per character instead.
Is this Bacon cipher tool free and private?
Yes. It runs entirely in your browser with no sign-up, and nothing you type is uploaded or stored.

About this page

The Bacon Cipher is a free tool from Linguaholic, made by Marcel Iseli. It runs in your browser, with no sign-up. Last updated .

The code breaker's English letter frequencies and word checks come from Linguaholic’s English dictionary, built from the open ENABLE and SCOWL word lists. Licenses and notices.

Keep exploring

Browse all 99 tools