Bacon Cipher
Turn a message into Francis Bacon's five-letter groups of A and B, or read the groups back into text, in his original 24-letter alphabet or the modern 26-letter one. Then hide the code the way Bacon intended: inside an ordinary sentence, with every letter set in one of two styles.
Only letters are encoded: Bacon's alphabet has no codes for spaces, digits or punctuation.
Hide it in plain sight
Bacon's real idea: write any innocent text in two styles. Each letter of it carries one symbol — ordinary for a, the second style for b. Spaces and punctuation carry nothing.
Your message hidden in the cover text
The roses in the garden have been lovely all week, despite the rain.
The message is carried by the first 25 letters of the cover text; the rest stay plain.
To read it back, write a for each plain letter and b for each styled one, then decode the groups of five. Capitals survive plain-text copying: paste the result into Decode and choose letter case.
The biliteral alphabet
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
Each code is the letter's place in the alphabet counted from zero and written in binary, with a for 0 and b for 1. Letters in your message are highlighted.
How to Use the Bacon Cipher
- 1. Choose Encode or Decode. Encode turns letters into groups of five symbols; Decode reads the groups back into letters.
- 2. Pick the alphabet. Bacon's own has 24 letters — I and J share a code, and so do U and V. The 26-letter version gives every letter its own code. Decode with the alphabet the message was made with.
- 3. Pick the symbols. A and B is traditional, 0 and 1 shows the code for the binary it is, and custom symbols let you use any two characters. When decoding, everything except the two symbols is ignored, so spacing and line breaks do not matter.
- 4. Hide it. Under the result, type a cover text and choose a second style. Each letter of the cover carries one symbol, and the preview shows your message hidden inside it.
How the Baconian Cipher Works
Bacon called it a biliteral cipher: every letter is written with only two symbols, a and b, in groups of five. Five places with two choices each give 2 × 2 × 2 × 2 × 2 = 32 combinations. In modern terms each group is the letter's position, counted from zero, written in binary with a for 0 and b for 1 — A is aaaaa (0), B is aaaab (1), C is aaaba (2) — although Bacon set it out simply as a table.
| A to H | I/J to Q | R to Z |
|---|---|---|
A aaaaa | I/J abaaa | R baaaa |
B aaaab | K abaab | S baaab |
C aaaba | L ababa | T baaba |
D aaabb | M ababb | U/V baabb |
E aabaa | N abbaa | W babaa |
F aabab | O abbab | X babab |
G aabba | P abbba | Y babba |
H aabbb | Q abbbb | Z babbb |
The 26-letter alphabet agrees with Bacon's from A to I and differs from J onwards, where every letter needs a code of its own. The choice matters: JIVE in Bacon's alphabet is ABAAA ABAAA BAABB AABAA, which decodes as IIUE, while the 26-letter alphabet keeps the letters apart as ABAAB ABAAA BABAB AABAA.
Worked example
In Bacon's alphabet, Bacon encodes to AAAAB AAAAA AAABA ABBAB ABBAA — B, A, C, O, N. Hidden in the tool's sample cover text with capitals as the second style, it reads the rOses in the GarDEn HaVE been lovely all week, despite the rain. Sort the first 25 letters by case — lowercase for a, capital for b — and the five groups come back. With bold or italic as the second style, the same seven letters are simply set in bold or italics.
Hiding a Message in Plain Sight
The groups of a and b were never meant to travel as they are. Bacon's point was that any difference with two values can carry them — two slightly different typefaces, as he proposed, or roman and italic, upright and slanted, large and small. Written into an innocent letter, the message is invisible unless the reader knows to sort the letters into two kinds. That makes the biliteral cipher an early example of steganography: hiding the fact that there is a message at all, not just what it says.
Bacon published the method in De Augmentis Scientiarum (1623), writing that he had devised it while in Paris as a young man. Nearly three centuries later it sat at the centre of a literary controversy. From 1899 Elizabeth Wells Gallup claimed to find biliteral messages from Bacon in the varying type of Shakespeare's First Folio. William and Elizebeth Friedman, who began their codebreaking careers on her project at Riverbank Laboratories in Illinois, later examined such claims in The Shakespearean Ciphers Examined (1957) and found that none of them stood up.
Breaking the Baconian Cipher
Once the two kinds of letter are sorted, there is nothing left to break: the alphabet is fixed and public, so the groups read off directly. The only secret is the hiding place, and that is fragile. The carrying letters have to be distinct and consistent, which is exactly why readings of irregular seventeenth-century type were unconvincing. And if the codes are shuffled, each group is still one letter, so frequency analysis finishes the job.
Frequently Asked Questions
- What is the Bacon cipher?
- A method devised by Francis Bacon in which each letter becomes a group of five symbols drawn from just two, written a and b — A is aaaaa, B is aaaab, and so on. Because only two kinds of symbol are needed, the code can be hidden in any text that uses two styles of letter.
- How do I decode a Bacon cipher?
- Turn the message into a string of a's and b's, split it into groups of five and look each group up — or paste the a/b text into Decode mode and let the tool do it. Choose the right alphabet first: in Bacon's 24-letter original, I and J share a code, and so do U and V.
- What is the difference between the 24-letter and 26-letter Bacon cipher?
- Bacon's alphabet followed the Latin usage of his day, writing I and J with one code and U and V with another, which leaves 24 codes. The 26-letter version gives J and V codes of their own. The two agree from A to I, so decoding with the wrong one turns most letters after I into a neighbouring letter, and Y and Z into question marks.
- Can I use 0 and 1 instead of A and B?
- Yes. The code is binary in all but name: each group is the letter's position counted from zero, written in five binary digits with a = 0 and b = 1, so C is 00010, the number 2. Choose 0 and 1, or any two characters, under Symbols.
- How does Bacon's cipher hide a message in text?
- Each letter of an ordinary cover text stands for one symbol — normal letters for a, letters in a second style for b. Five cover letters carry one letter of the secret, so the cover needs five times as many letters as the message. Bacon proposed two subtly different typefaces; the tool demonstrates the idea with bold, italic or capitals.
- Did Bacon hide messages in Shakespeare's plays?
- There is no good evidence that he did. Claims that the First Folio carries biliteral messages, made most famously by Elizabeth Wells Gallup, depended on sorting irregular printed letters into two kinds by eye. William and Elizebeth Friedman reviewed those claims in 1957 and found none that held up.