Bacon’s cipher, devised by Francis Bacon around 1605, is really a method of steganography: it encodes a message as a binary pattern and then hides that pattern inside ordinary-looking text. Each letter of the secret message becomes a group of five symbols drawn from just two values, traditionally written as A and B. This tool encodes text into those 5-symbol groups and decodes them back, in your browser.
How it works
Assign every letter a fixed 5-symbol code built from two characters. With five positions and two values there are 32 possible patterns, more than enough for the alphabet. The classic 24-letter table starts at A=AAAAA, B=AAAAB, C=AAABA and continues in order, with I and J sharing a code and U and V sharing a code.
To encode, replace each letter with its group and discard anything that is not a letter. To decode, normalise the input into A and B symbols (treating 0 as A and 1 as B), split it into groups of five, and look each group up in the table. Bacon’s true trick was then to hide the A/B values as two slightly different fonts inside an innocent cover text.
Example
Encode the word GERA in the 24-letter scheme:
- G →
AABBA - E →
AABAA - R →
BAAAA - A →
AAAAA
So GERA becomes AABBA AABAA BAAAA AAAAA. Decoding those groups returns the original letters.
Notes
Because I/J and U/V share codes, decoded text may show an I where a J was meant, or a U where a V was meant — resolve these from context. The binary nature of the cipher makes it a neat introduction to encoding information in 5-bit units, the same idea behind Baudot teleprinter codes.