The Magic Codex

Bacon's Cipher

Write in two symbols — or hide a message in plain sight. Francis Bacon's biliteral cipher, with the original two-typeface steganography trick.

How to use Bacon's cipher

In 1605 Francis Bacon published the first binary code — a century before Leibniz. Each letter became five "a"s and "b"s, and because a secret needs only two distinguishable states, Bacon realized it could hide inside the shape of an ordinary page rather than in scrambled letters.

  1. Type a message in the box at the top.
  2. Encode with A/B letters to see the classic 5-symbol groups — HELLO becomes AABBB AABAA ABABA ABABA ABBAB.
  3. Try the steganography demo: switch to "Two typefaces", write a cover paragraph, and watch your secret vanish into bold and regular letters.
  4. Decode: paste any A/B groups (or 0s and 1s) and switch to Decode. I/J and U/V come back merged, exactly as Bacon's 24-letter alphabet demands.

The 24-letter alphabet

Bacon's Latin alphabet had no J and no V. Following the original scheme, this tool folds J into I and V into U when encoding; decoding shows I/J and U/V because the ciphertext genuinely cannot distinguish them. Round-trips are honest about this: decode(encode("JOVE")) gives "I/JOU/VE".

Cryptography vs. steganography

A cipher scrambles the message; steganography hides the fact that a message exists at all. Bacon's cipher is one of the rare inventions that does both at once — the A/B letters are cryptography, the two-typeface trick is steganography. Modern image watermarking and "invisible" text tracking work on the same principle.

What is Bacon's cipher?
Francis Bacon's biliteral cipher (1605) writes each letter as a 5-bit pattern of two symbols, a and b. A becomes AAAAA, B becomes AAAAB, and so on through a 24-letter alphabet. Because a message needs only two distinguishable states, Bacon hid secret messages inside ordinary printed text using two typefaces — bold for b, regular for a.
Why are there only 24 letters? Where did J and V go?
Bacon used the 24-letter Latin alphabet of his day, which had no J (it was written I) and no V (written U). This tool follows that original scheme: J encodes as I and V encodes as U, and decoding shows I/J and U/V because the ciphertext cannot tell the merged letters apart.
How does the two-typeface steganography demo work?
Type a secret message, switch to 'Two typefaces', and write a cover text. The tool turns cover-text letters bold (bit B) or leaves them regular (bit A), spelling your message out across the letters. Without knowing to look for the typeface difference, the cover text reads as an ordinary paragraph — exactly Bacon's original trick.
Can I decode a message typed as 0s and 1s?
Yes. The decoder accepts A/B in any case and also 0/1 (0 means A, 1 means B). Any other characters — spaces, line breaks, punctuation — are ignored as separators, so you can paste grouped output back in directly.
Is Bacon's cipher secure?
No. As a cipher it is a simple substitution — a computer spots it instantly, and once the reader knows to compare typefaces the hiding stops working. It is wonderful for puzzles, treasure hunts, and learning the difference between cryptography and steganography, but never for real secrets.
Is my text sent anywhere?
No. All encoding happens in your browser with JavaScript. Nothing is uploaded, stored, or tracked.

Need help with this tool?

Found a bug, or have a suggestion for the codex? Write to us — a real human reads every message.

[email protected]

More from the codex