Bacon Cipher Converter
Encode letters as groups of five A and B symbols with the Baconian cipher.
What it does
Bacon's cipher, also called the Baconian or biliteral cipher, encodes each letter as a group of five symbols drawn from two distinct classes, conventionally written A and B. Francis Bacon devised it in the early seventeenth century as a form of steganography.
This tool uses the common twenty four letter alphabet, where I and J share a code and U and V share a code. Encryption converts each letter to its five bit index with A standing for 0 and B for 1. Decryption reads groups of five back into letters.
The page opens with the word BACON. Its codes are AAAAB, AAAAA, AAABA, ABBAB and ABBAA, which concatenate into a continuous A and B string.
Historically the two classes could be represented by two typefaces, shapes or other visual differences hidden in an innocent looking text. The tool works directly with the A and B symbols rather than a cover text.
Because I and J and also U and V share codes, the decoded message needs context to choose the intended letter.
How to use
- Type a message of letters for encryption.
- Choose encrypt or decrypt.
- Read the A and B string as the main result.
- For decryption, enter groups of exactly five A and B symbols.
- Check the letter count to confirm the conversion.
- Use context to decide between I and J or U and V after decryption.
Formula
- letter index
- Position in the twenty four letter Baconian alphabet.
- five bit binary
- The index written with five binary digits.
- A/B pattern
- The binary digits with 0 replaced by A and 1 by B.
The place values of the five positions are 16, 8, 4, 2 and 1. The twenty four letter convention stops at index 23, so the patterns for indices 24 to 31 are unused.
Worked example
Example: BACON
The page opens with the word BACON in encrypt mode.
- B has index 1, which is 00001 in five bits, giving AAAAB.
- A has index 0, giving AAAAA.
- C has index 2, giving AAABA.
- O has index 14, giving ABBAB.
- N has index 12, giving ABBAA.
- The tool reports the concatenated result AAAABAAAAAAAABAABBABABBAA.
Reference table
| Letter | Index | Five bit binary | A/B pattern |
|---|---|---|---|
| A | 0 | 00000 | AAAAA |
| B | 1 | 00001 | AAAAB |
| C | 2 | 00010 | AAABA |
Limits
- Encryption accepts at most 100 letters.
- Decryption requires a length that is a multiple of five.
- Uses the twenty four letter alphabet with shared I/J and U/V.
- The classic two typeface steganography is not modelled.
Common mistakes
- Using the twenty six letter variant codes by mistake.
- Splitting the A/B stream into groups other than five.
- Expecting the tool to decide between I and J.
- Entering lowercase b instead of B in cipher mode.
- Assuming the cipher conceals the existence of a message on its own.
Try it yourself
Quick checks. Answers sit tucked under each question.
What is the Baconian code for A?
AAAAA, index zero.
Which letters share a code?
I and J share ABAAA, and U and V share BAABB.
How long is the code for one letter?
Five A or B symbols.
Questions
What is Bacon's cipher?
A method of encoding each letter as five symbols from two classes.
Why five symbols?
Five binary digits provide enough patterns for the alphabet.
Is it a substitution or steganography?
Both. The A/B patterns substitute for letters and can be hidden in two typefaces.
How do I decode?
Split into groups of five, convert A to 0 and B to 1, then map the index to a letter.
What about J and V?
They share codes with I and U in the common variant.
Is it secure?
No. The pattern is regular and easy to recognise.