ToolJutsu
All tools
Text Tools

Bacon Cipher

Hide messages with the classic Bacon cipher.

Each letter becomes a 5-character group of A and B (e.g. A = AAAAA, Z = BBBAA). Spaces between words become double spaces in the output.

The 26-letter Baconian variant is used here — each letter has a unique 5-bit code. Bacon cipher is a steganographic technique from 1605, not a security tool. Do not use it to protect sensitive information.

Processed on your device. We never see your files.

How to use Bacon Cipher

What this tool does

The Bacon Cipher tool converts text to and from the Baconian encoding that Sir Francis Bacon published in 1605. Every letter of the alphabet is represented by a unique 5-character sequence of the letters A and B. This tool uses the 26-letter variant, where every one of the 26 English letters has its own distinct code: A encodes as AAAAA, B as AAAAB, C as AAABA, and so on through the alphabet to Z, which encodes as BBBAA.

In encode mode, each letter in your text is replaced with its 5-character group. Groups are separated by spaces, and word boundaries become double spaces. In decode mode, the tool strips any characters that are not A or B, groups the remaining characters into blocks of five, and looks up each block in the encoding table to produce the original letter. If the number of A/B characters does not divide evenly by five, the tool shows a clear error rather than silently producing a partial or wrong result. Everything updates in real time.

Why you might need it

The Bacon cipher has a distinctive place in the history of information encoding. Bacon invented it not as a cipher in the modern sense but as a steganographic technique — a way to conceal the fact that a message exists at all. By printing a document in two slightly different typefaces, one for A and one for B, a secret message could be hidden inside an entirely innocent-looking piece of text. The reader would only discover it if they knew to look.

That steganographic tradition makes the Bacon cipher a favourite in puzzles, escape rooms and ARGs, where the two-symbol encoding can be hidden in images, binary patterns, musical notes, capital versus lowercase letters, or any other binary distinction. It also has a legitimate place in cryptography and computer science education as an early example of binary encoding — the five-bit codes map directly onto the first 26 values of a 5-bit binary system, making it a natural bridge between historical ciphers and modern computing.

How to use it

  1. Choose Encode to convert plain text into Baconian groups, or Decode to recover plain text from Baconian groups.
  2. Type or paste your text into the input box.
  3. In encode mode, each letter immediately becomes a 5-character A/B group in the output. In decode mode, the A/B groups are translated back to letters.
  4. Click Copy output to copy the result to your clipboard.
  5. Use Load sample to see an example, or Clear to start fresh.

Common pitfalls

When decoding, the most common problem is mismatched group sizes. Every decoded letter requires exactly 5 A or B characters. If a group is cut short — because a character was accidentally omitted — the tool will show an error asking you to check for missing characters. Count the A/B characters in groups of five: if the last group has fewer than five, a character is missing.

A second trap is forgetting that only A and B matter in the input for decoding. Spaces, separators, newlines and any other characters are stripped before grouping, so “AAAAA AAAAB” and “AAAAAAAAAB” both decode the same way. This is useful when pasting Baconian text that uses various separators, but it means a stray A or B hidden in a separator will be included in the decode — use only non-AB characters as separators to be safe.

Digits, punctuation and accented letters cannot be encoded in standard Baconian, so they are silently replaced by a space marker in the output. If you need to encode a number, write it out as a word.

Tips and advanced use

The steganographic angle is where Bacon cipher shines as a puzzle tool. Encode your secret message into Baconian groups, then conceal the A/B distinction in some other binary feature of a cover text: capitals versus lowercase, bold versus plain, short words versus long words, or any two distinct visual states. The result looks like ordinary text but carries a hidden message readable only to someone who knows to look for the pattern.

For escape rooms, the Bacon cipher works particularly well when combined with a physical prop — a piece of music where two note values encode the message, or a grid of black and white squares that a player must photograph and decode. The 5-bit structure also lends itself to patterns made from everyday objects: five items in a row, each either in state A or state B.

Since the entire tool runs in your browser, there is no risk in pasting real or unpublished text here to experiment. Nothing is stored or transmitted.

Frequently asked questions

Is my text processed on a server?
No. All encoding and decoding happens in your browser using JavaScript. Nothing you type is sent anywhere — there are no network requests. You can verify this with the Network tab in your browser's developer tools.
What is the Bacon cipher?
The Bacon cipher — correctly called the Baconian cipher — was devised by Sir Francis Bacon and published in 1605. It represents each letter of the alphabet as a unique 5-character combination of two symbols, which Bacon called 'a' and 'b'. This tool uses the 26-letter variant, where every letter of the alphabet has a distinct code, as opposed to an older variant that shared codes between some letter pairs. The original intent was steganographic: the two symbol types could be hidden in a text by using two different typefaces, so the encoded message was concealed inside an innocent-looking document.
How do I decode a Bacon cipher message?
Switch to Decode mode and paste the Baconian groups into the input. The tool strips all characters that are not A or B, groups the remainder into blocks of five, and looks up each block to find the corresponding letter. The groups must divide evenly — if you have leftover characters after grouping into fives, the input is incomplete and the tool will tell you.
Is the Bacon cipher secure?
No. The Bacon cipher has no secret key — its encoding table is fixed and well-known. Anyone who recognises the pattern of As and Bs can decode it with a lookup table or this tool in seconds. It was designed for steganography (hiding that a message exists at all) rather than encryption (making the message unreadable). It offers no protection and must not be used for sensitive information.
What happens to digits, spaces and punctuation when encoding?
Only the 26 Latin letters are encoded into Baconian groups. Digits and punctuation do not have codes in the standard Baconian alphabet, so they appear as a space in the encoded output. Word spaces become double spaces, which you can use to read the word boundaries in the encoded text if needed.

Related tools