"The Gold Bug Cryptogram"

by Robert Giordano, created 21 Aug 2019 5:11pm


21 August 2019

Edgar Allan Poe's short story The Gold Bug is about finding buried pirate treasure. In the story, Mr. Legrand explains how he solved a cryptogram, revealing the location of the treasure. The encoded message given in the story can actually be solved in real life!! The problem is, there are errors in many of the available texts. In this essay, I will document those errors, explain the solution to the cryptogram, and show you how to create and solve your own encrypted messages.


I've been interested in cryptography, the art of writing and solving codes, since I was 10 years old. At 13, I became fascinated with computers, programming, and "hacking". It was about this time I also became a huge fan of Edgar Allan Poe. Imagine my excitement the first time I read the Gold Bug with its encrypted message. I checked the first few characters of the cryptogram and sure enough, if you follow Legrand's instructions, those symbols convert to the words, "a good glass..." I didn't need to solve the rest. I assumed it was all correct. Years later, I discovered I was wrong...

One day, I was reading The Gold Bug from my hardcover volume, "The Complete Tales and Poems of Edgar Allan Poe", from Barnes and Noble. Just for fun, or perhaps because of the way my brain works, I decided to count the characters in the cryptogram and compare the total to the answer quoted on my website. They were different!! Now that my curiosity was aroused, I decided to solve the cryptogram on paper. Was there a flaw in my Poe anthology??

A Correct Version???

Next, I looked at both printed and online versions of "The Gold Bug" and I found many differences!! When I narrowed it down, there were two distinct versions and a number of smaller mistakes that I believe were the result of printing or scanning errors.

Poe knew what he was doing when it came to cryptography. He challenged readers to send in their own cryptograms and he solved every single one. In the December 1839 issue of the Alexander's Weekly Messenger, Poe claimed he could solve any cipher that readers cared to submit...

"It would be by no means a labor lost to show how great a degree of rigid method enters into enigma-guessing. This may sound oddly; but it is not more strange than the well know fact that rules really exist, by means of which it is easy to decipher any species of hieroglyphical writing -- that is to say writing where, in place of alphabetical letters, any kind of marks are made use of at random. For example, in place of A put % or any other arbitrary character --in place of B, a *, etc., etc. Let an entire alphabet be made in this manner, and then let this alphabet be used in any piece of writing. This writing can be read by means of a proper method. Let this be put to the test. Let any one address us a letter in this way, and we pledge ourselves to read it forthwith--however unusual or arbitrary may be the characters employed. " [source]

Two Solutions

I don't believe Poe made these errors in his original cryptogram for The Gold Bug. We all make mistakes so of course its possible, but there are multiple errors. Also, there are TWO DIFFERENT versions of the cryptogram itself!! Lets begin by working backwards from the solution(s).

The first solution to Poe's original cryptogram, published 1843, in the Dollar Newspaper reads:

A good glass in the bishop's hostel in the devil's seat forty-one degrees and thirteen minutes northeast and by north main branch seventh limb east side shoot from the left eye of the death's-head a bee line from the tree through the shot fifty feet out. [source]

A second solution to Poe's cryptogram appears as follows:

A good glass in the bishop's hostel in the devil's seat twenty-one degrees and thirteen minutes northeast and by north main branch seventh limb east side shoot from the left eye of the death's-head a bee line from the tree through the shot fifty feet out. [source1] [source2]

The only difference in the two solutions is "forty" in the first, and "twenty" in the second. From here on I will refer to them as the "forty" and "twenty" versions. Each version of the story also repeats the word "forty" or "twenty" as appropriate. The cryptogram is also different in each version.

Since 2005, when I built, I've been using the "twenty" version. It is the same version used on the Wikipedia page (as of 22 Aug 2019).

My Poe anthology from Barnes and Noble uses the "forty" version, which is why the cryptogram in the book differed from the one on my site by a few characters. Other books and online sources have one or the other.

I Just Switched to "Forty"

I have just edited the text of The Gold Bug on to use the "forty" version. Why do this after 14 years? Why go against the Wikipedia version? Because I think its the most accurate thing to do and I'm hoping the people who maintain the Wikipedia page and other pages around the internet will agree with me.

In ALL VERSIONS of the story, Legrand counts the symbols in the message and constructs a table of the letter frequencies:

  Of the character 8 there are 33.
                   ;     "     26.
                   4     "     19.
                   )     "     16.
                   ‡     "     16.
                   *     "     13.
                   5     "     12.
                   6     "     11.
                   †     "     8.
                   1     "     8.
                   0     "     6.
                   9     "     5.
                   2     "     5.
                   :     "     4.
                   ?     "     3.
                   ¶     "     2.
                   -     "     1.
                   .     "     1.

This table is the same in every version of the story, regardless of whether it uses "forty" or "twenty". If the cryptogram uses "twenty", the numbers in the table are WRONG !!

Comparing the "forty" and "twenty" versions, we get:

Character    "forty"    "twenty"
    8          33          34  
    ;          26          27  
    *          13          14  
    1           8           7  

I don't think Poe miscounted the letters 4 times when he was writing the story! I also realize this doesn't affect how people enjoy the story. I'm sure 99.9 percent of the time, people aren't going to count the characters and try to solve the cryptogram themselves.

But, Poe put a real cryptogram in his story, and he actually teaches you how to solve it through Legrand's dialog. I don't think Poe intended to publish the story with the wrong information. This is why I have switched to the "forty" version, which I believe was Poe's original.

Checking Sources

I wish it was just a simple matter of choosing the "forty" or "twenty" version, but alas, there are other problems. Many versions of the text have other errors in the cryptogram. These are either printing errors or scanning errors made when people scanned the original text for online use. Again, I know these errors don't prevent anyone from enjoying the story, but if they're easy enough to fix, why not do it? Why not restore one of Poe's masterpieces to its original perfection?

Lets take a look at the decoded "forty" cryptogram:








There are 203 characters in the "forty" cryptogram.

I already mentioned that my Poe Anthology from Barnes and Noble uses the "forty" version. Here are two more vintage Poe books that I own:

  • Prose Tales by Edgar Allan Poe, New York: Thomas Y. Crowell & Company, 1898
    - uses the "forty" version
    - uses a captital "I" instead of "1"
    - cryptogram has 203 characters, no errors

    photo of the Gold Bug cryptogram from Prose Tales by Edgar Allan, 1898
  • Best Known Works of Edgar A. Poe, Introduction by Harvey Allen, New York: Walter J. Black Co., 1927
    - uses the "forty" version
    - uses a captital "I" instead of "1"
    - cryptogram has 203 characters, no errors

    photo of the Gold Bug cryptogram from Prose Tales by Edgar Allan, 1898

I think I made the right choice to switch to the "forty" version. I'm not sure how the "twenty" version came to be. Maybe another editor changed it?


Lets look at some of the most popular online texts:

  • Google Books: The Gold Bug and Other Selections, edited by Robert Armistead Stewart, 1912, page 49
    - each "page" is an image of the actual page in the book
    - uses the "twenty" version but both t's in "twenty" are missing:


  • The Gold Bug - Edgar Allan Poe, University of Adelaide ebooks
    - ASCII characters are used instead of ࠦ
    - still has the problem with both t's in "twenty" missing:

    !8'60))85;]8*:+*8!83(88) devilsseatwenyonedegrees

  • A descent into the Maelstrom; The gold-bug; Mellonta tauta ..., University of Oxford Text Archive
    - There is a download link for a ZIP file containing the text
    - ASCII characters are used instead of ࠦ
    - uses the "forty" version but is missing 5 characters in line 1:



    - Capital "I" is used for "f" (see previous line) until this last line, where number 1's appear instead:

    throughtheshot i ty eetout

  • Project Gutenberg's The Works of Edgar Allan Poe, Plain Text UTF-8 version selected from menu
    - uses the "forty" version
    - missing "p" in "bishops", "fosty" instead of "forty":



    - there's an extra "c" in "branch":


I'm going to send a few emails and hopefully some of these errors will be corrected. When they are, I will update this post.

Cryptography Tools

If you want to learn more about solving these types of puzzles or you want to create your own encoded messages, I've created a few simple tools to help you:

  • Cryptogram Maker
    This tool takes any message and encodes it just like the message in the story. To see how it works, visit the page and click the links for "Poe's text" and "Poe's key". This fills in the form with the plaintext message and code key from The Gold Bug. Click "ENCODE" and you'll get the original encoded message from the story!

    With this tool, you can encode your own messages using Poe's key, you can generate random keys, or you can type in your own 26 letter key. You can send encoded messages to your friends and see if they can solve them!
  • Character Counter
    This is one of the first online tools I ever built. It simply counts characters as you type them. The extra thing it does is count how many of EACH one is entered. So, you don't have to count the totals of each character in a cryptogram! Just paste the encoded message in the form and get the totals instantly, sorted by frequency. Try it with the Gold Bug cryptogram (the correct one!) and you'll get Legrand's chart, showing "8" appears 33 times, etc.
  • Word Pattern Finder
    In the story, Legrand makes it sound easy to come up with words that fit the same patterns as the symbols in the cipher. But thinking of words like that is harder than it sounds. This tool helps you find words to fit patterns.

    Under "DIRECTIONS AND TIPS", the first example uses ;46(;88* (from the Gold Bug cryptogram) in the PATTERN field, and  finds 20 words. If you know that "88" is "ee", you can narrow the list down to 3 words, and one of them is "thirteen".

If you have any questions or comments, please post them below. Thanks!

- Robert



27 Aug 2019 4:34pm, anonymous

"Just thought you should know Wikisource ( has the same version of the cryptogram as yours, and it solves correctly with no errors. Maybe show that to Wikipedia?"


add a comment

< Back to Topics