Bacon Cipher (Baconian Cipher) Decoder and Encoder
Type your text to get Bacon code, or paste A/B groups to read them. The result appears as you type.
The Bacon cipher key: each letter is its position in the alphabet (A = 0) written in binary with A for 0 and B for 1.
Bacon Cipher Worksheet
Name: ____________________ Date: ______________
Key: each letter is a group of five A/B symbols.
Message:
Write the answer here:
Made with Crossword Print · crosswordprint.com/bacon-cipher/
The Bacon cipher, also called the Baconian cipher, is a code that replaces each letter with a group of five A or B symbols. This free Bacon cipher tool encodes text into that code and decodes it back, and it runs entirely in your web browser with no sign-up.
The tool supports two versions: the 24-letter original and a 26-letter version where every letter has its own code. You can choose between A and B or 0 and 1 as the symbols, and you can decode a message even if it is written with or without spaces. It also includes a key table of every letter’s code, a print option for a worksheet, and a way to hide the code inside an ordinary sentence.

How to use the Bacon cipher tool
- Under the tool, pick a direction: Encode text to Bacon code or Decode Bacon code to text.
- Choose an alphabet: 24-letter (I=J, U=V) is the default, or pick 26-letter (every letter) so each letter has its own code.
- For encoding, type or paste your message into the Your text box. The Baconian code box shows the result and updates as you type.
- For decoding, paste the code into the Baconian code box. The output appears in the Decoded text box. Spaces, commas and line breaks are ignored.
- Choose the symbols A and B or 0 and 1 to change how the code is written.
- Tick No spaces between groups if you want the code as one unbroken string.
- To hide the code in ordinary text, use the optional carrier box in encode mode. Paste a sentence, and the tool shows how many more letters you need if the sentence is too short.
- Click Copy Result to copy the output, or Use Result as Input to move it into the input box and switch direction.
Click Try an Example to load a sample message, and Clear to empty both boxes. Print Key & Message creates a worksheet with the key table, your message and answer lines. The worksheet is free for home, classroom and commercial use.
What is the Bacon cipher?
The Bacon cipher is a substitution code devised by Francis Bacon, who described it in his 1623 work De Augmentis Scientiarum. Each letter is replaced by a five-symbol group made from the letters A and B, so every letter has a fixed pattern. In the original 24-letter version, I and J share one pattern and so do U and V. The code is called the Baconian cipher in many books and sites, and the two names mean the same thing.
Bacon’s wider idea was to hide a message inside the appearance of ordinary text, not just to scramble it. This is steganography: the message is concealed rather than only scrambled, because the A and B symbols can be shown as two slightly different looks of letters, such as plain and bold, in an innocent-looking sentence. Today it is mostly used for puzzles, escape rooms, lessons on codes, and as an example of binary encoding.
How does the Baconian cipher work?
Each letter is converted to its position in the alphabet, counted from 0 so that A is 0. That number is written in binary, five digits long, and then A is written for 0 and B for 1. A is 0, which is AAAAA, and B is 1, which is AAAAB.
For example, HELLO becomes AABBB AABAA ABABA ABABA ABBAB. In the 24-letter version, I and J share the code ABAAA, and U and V share BAABB. Z is BABBB. In the 26-letter version, J is ABAAB, V is BABAB, and Z is BBAAB.
Decoding works in reverse. The code is cut into groups of five from the start, and each group is matched to a letter in the chosen alphabet. Five symbols give 32 possible groups, which is enough for the 24 or 26 letters the cipher needs.
How do you decode a Bacon cipher by hand?
Cut the code into groups of five symbols, starting at the left. Look each group up in the key table and write down its letter. For example, AABBB is H and AABAA is E, so the first two groups of the HELLO example above read HE. If a message is written without spaces, count five symbols at a time. If you are not sure which version was used, try the 24-letter alphabet first, then the 26-letter one, and see which gives readable words.
Frequently asked questions
How do I decode a Bacon cipher?
Select Decode Bacon code to text, then paste the code into the Baconian code box. Make sure the alphabet matches the version used to write the message, because a group such as BBAAB is valid in the 26-letter version but shows as ? in the 24-letter version.
What is the difference between the 24-letter and 26-letter Bacon cipher?
The 24-letter version is the original, where I and J share one code and U and V share another. The 26-letter version gives every letter its own code, so J, V and Z have different codes than they do in the 24-letter version.
Can I hide a Bacon cipher message in normal text?
Yes. In encode mode, paste a sentence into the carrier box. Bold letters count as B and plain letters count as A, and the tool prints your carrier sentence with the B letters in bold. Digits, spaces and punctuation are skipped, so you may need a longer sentence for a long message.
Is the Bacon cipher secure?
No. It is a substitution with a fixed, public table and no key, so anyone who knows the method can read it. It is suitable for games, teaching and puzzles, not for protecting sensitive information.
Can I print a worksheet?
Yes. Click Print Key & Message to print a page with the key table, your message and answer lines. You can use the worksheet at home, in a classroom, or for commercial use.
Why does the Bacon cipher use five symbols?
Five symbols, each either A or B, give 32 different combinations. That is more than the 24 or 26 letters needed, so every letter can have its own unique group.
Related tools
- Atbash cipher: Use it to try another simple substitution code that reverses the alphabet.
- Caesar cipher: Use it when you want to shift letters by a fixed number.
- Cipher decoder and identifier: Use it when you have a coded message and want to guess which cipher was used.
- Pigpen cipher: Use it to work with a symbol-based code that uses grid shapes.
- Polybius square: Use it to encode letters as pairs of coordinates in a grid.
- Rail fence cipher: Use it to scramble a message by writing it in a zigzag pattern.
- Morse code translator: Use it to convert letters into dots and dashes.