Bacon Cipher Encoder and Decoder
Encode and decode the Baconian cipher. Each letter is five A or B symbols. Choose the original 24-letter or the 26-letter alphabet, A/B or 0/1.
How it works
Francis Bacon's cipher writes each letter as a group of five symbols, each either A or B. The groups are the letter's position in the alphabet written in binary, with A for 0 and B for 1: A is AAAAA, B is AAAAB, C is AABAA, D is AAABB and so on. Bacon's original alphabet from 1605 has 24 letters, because I and J share a code, and so do U and V. The modern 26-letter version gives every letter its own code, so letters from J on have different codes in the two versions. When encoding, letters are written as groups separated by spaces and words are separated by a slash; digits and punctuation are dropped. When decoding, everything except A and B (or 0 and 1) is ignored, the symbols are read five at a time, and a slash starts a new word. Bacon meant the two symbols to be hidden in an innocent text, for example as two typefaces, so the message is not visible at all.
Example: in the 24-letter version, HI BOB becomes AABBB ABAAA / AAAAB ABBAB AAAAB.
Bacon cipher alphabet
Codes of each letter in both versions. They differ from J onwards.
| Letter | 24 letters | 26 letters |
|---|---|---|
| A | AAAAA | AAAAA |
| B | AAAAB | AAAAB |
| C | AAABA | AAABA |
| D | AAABB | AAABB |
| E | AABAA | AABAA |
| F | AABAB | AABAB |
| G | AABBA | AABBA |
| H | AABBB | AABBB |
| I | ABAAA | ABAAA |
| J | ABAAA | ABAAB |
| K | ABAAB | ABABA |
| L | ABABA | ABABB |
| M | ABABB | ABBAA |
| N | ABBAA | ABBAB |
| O | ABBAB | ABBBA |
| P | ABBBA | ABBBB |
| Q | ABBBB | BAAAA |
| R | BAAAA | BAAAB |
| S | BAAAB | BAABA |
| T | BAABA | BAABB |
| U | BAABB | BABAA |
| V | BAABB | BABAB |
| W | BABAA | BABBA |
| X | BABAB | BABBB |
| Y | BABBA | BBAAA |
| Z | BABBB | BBAAB |
Hiding a Bacon message in plain text
Bacon's idea was steganography: write any innocent sentence and use two typefaces, for example normal and bold letters, so that normal means A and bold means B. Every five letters of the cover text carry one letter of the secret. To read such a message, write A or B under each letter of the cover text and paste the A/B string here.
Frequently asked questions
How do I decode a Bacon cipher?
Choose Decode and paste the A and B groups. If the result looks wrong from the letter J onwards, switch between the 24-letter and 26-letter alphabet.
What if the message uses other symbols, not A and B?
Any two kinds of things can stand for A and B: bold and normal letters, upper and lower case, 0 and 1. Rewrite them as A and B (or 0 and 1) and paste them here.
Which alphabet should I use?
Use 24 letters for historical texts and most older puzzles, and 26 letters when every letter, including J and V, must decode separately.
Is the Bacon cipher binary code?
Each group is a 5-bit binary number with A for 0 and B for 1, so it is closely related. Computer binary for letters uses 8-bit bytes instead; see the binary translator for that.
Who was Francis Bacon?
An English philosopher and statesman who described this cipher in 1605 and published it in 1623 as a way to hide a message inside another text.
Is my text sent to a server?
No. Everything runs in your browser and the text you type is not sent anywhere.
More text tools
Cipher Decoder and Identifier
Morse Code Translator
Binary Translator
ASCII Converter
Hex to Text Converter
Leet Speak Translator
Caesar Cipher Encoder and Decoder
Vigenere Cipher Encoder and Decoder
Atbash Cipher Encoder and Decoder
Word Counter and Character Counter
ROT13 Decoder and Encoder
Playfair Cipher Encoder and Decoder
Rail Fence Cipher Encoder and Decoder
Braille Translator
Pigpen Cipher Translator
Letter to Number Converter (A1Z26)
Tap Code Translator
Polybius Square Cipher
Bacon's cipher is a historical code for puzzles and learning, not for real secrets.