Facts Get the app
← All articles
πŸ’» Technology

Was the first computer bug really a moth? The true story behind the legend

In 1947, a real moth jammed a Harvard computer and got taped into the logbook. But engineers had been chasing "bugs" since Edison's day.

⏱️ 5 min Sources checked
In short
  • πŸ¦‹ In September 1947, operators of Harvard's Mark II found a real moth in a relay and taped it into the logbook.
  • πŸ’‘ The word "bug" for a technical glitch is much older. Thomas Edison used it in an 1878 letter.
  • πŸ‘©β€πŸ’» Grace Hopper made the story famous, but she probably didn't find the moth or write the entry.

What happened on September 9, 1947

Picture a room-sized machine at Harvard University, clicking away with thousands of electromechanical switches. This was the Mark II Aiken Relay Calculator, an early computer that ran on relays instead of chips. One afternoon it misbehaved, and the operators went looking for the cause.

They found it in Relay #70, Panel F: a moth trapped between the contacts, according to the Naval History and Heritage Command's photo caption. Instead of just throwing it away, they taped the moth into the machine's logbook. Beside it they wrote: "First actual case of bug being found." The Centre for Computing History dates the entry to 15:45.

The page still exists, with the moth still attached. In 1988 the log was kept at the Naval Surface Warfare Center Computer Museum in Dahlgren, Virginia. Today it belongs to the Smithsonian's National Museum of American History.

πŸ’‘ Aha

The note says "first actual case," and that's the punchline: the joke only works because "bug" already meant a glitch.

An aha moment like this every day – in 10 seconds.Facts Β· β˜… 4.8 Β· Free Get the app

Edison was chasing bugs 70 years earlier

Read the logbook entry closely. The operators weren't inventing a word. They were making a pun. Engineers already called a mysterious fault a "bug," so finding a literal insect in the machine was too good not to record.

How much older is the word? In 1878, Thomas Edison wrote to his business associate Theodore Puskas about how "'Bugs' β€” as such little faults and difficulties are called β€” show themselves." That quote is documented in Computerworld's look at the word's origins, which notes that inventors and engineers were talking about bugs long before the moth.

The press picked up the word too. According to JSTOR Daily, the Oxford English Dictionary cites the Pall Mall Gazette of March 11, 1889, which described Edison hunting a "bug" in his phonograph. By 1934, Webster's New International Dictionary listed "a defect in an apparatus or its operation" as one meaning of "bug."

Did the moth give us "debugging"?

Not really. The popular story says the moth inspired engineers to talk about "debugging" computers. JSTOR Daily calls that version "not very etymologically correct."

"Debug" shows up in print in a 1945 issue of the Journal of the Royal Aeronautical Society, two years before the moth. And it was probably spoken engineering slang for some years before that. The moth didn't create the vocabulary. It just gave it a perfect mascot.

πŸ’‘ Aha

The moth didn't invent the computer bug, but it's probably the most famous piece of evidence for one.

So where does Grace Hopper fit in?

Many retellings say Grace Hopper pulled out the moth and wrote the note herself. The truth is a bit less tidy. Hopper did work on Harvard's computers. Yale describes her working on the first electromechanical computer in the United States under Howard Aiken, after getting a waiver to join the U.S. Naval Reserve during World War II.

But the Smithsonian describes the logbook as "probably not Hopper's," as JSTOR Daily reports. Computerworld puts it more bluntly: Hopper often talked about the moth in the relay, but she didn't make the discovery or the log entry. The page itself doesn't say who taped the moth in.

What Hopper did was tell the story, again and again, to audiences everywhere. A 1981 article in the Annals of the History of Computing already called it "Grace Murray Hopper's famous 'bug' story." She had a huge stage for it. According to Yale, she was widely credited with designing COBOL, which was the world's most widely used programming language by the 1970s. She retired as a rear admiral at 79, the oldest serving officer in the U.S. armed forces.

Why the legend keeps getting details wrong

The moth story is so neat that it keeps getting "improved" in the retelling. Even the official record has a slip. The Navy's photo caption dates the moth to September 9, 1945. Computerworld points out that the Mark II didn't come online until summer 1947, so 1945 can't be right.

So here's the honest version. In 1947, a real moth really did jam a real computer, and someone really did tape it into the log with a joke. But it wasn't the first bug, it didn't coin the word, and it probably wasn't Grace Hopper's discovery. It's still a great story. It just isn't the one most people tell.

Frequently asked questions

Who found the first computer bug?

The moth was found by operators of the Harvard Mark II in September 1947, but the logbook doesn't name the person. The Smithsonian says the logbook was probably not Grace Hopper's, even though she made the story famous.

Where is the moth from the first computer bug now?

It's still taped into the original logbook, which belongs to the Smithsonian's National Museum of American History. Before that, the log was kept at a Navy computer museum in Dahlgren, Virginia.

Who first used the word "bug" for a technical problem?

Nobody knows who said it first, but Thomas Edison was using it in writing by 1878. He described bugs as "little faults and difficulties," which suggests the term was already common among engineers.

Did Grace Hopper invent the term "debugging"?

No. "Debug" appeared in an aeronautics journal in 1945, before the moth was found. Hopper popularized the moth story, not the word.

Sources

JSTOR Daily: The Bug in the Computer Bug Story

Computerworld: Moth in the machine: Debugging the origins of 'bug'

U.S. Naval Historical Center (via HyperWar/ibiblio): Photo NH 96566-KN: First Computer "Bug"

Centre for Computing History: First computer "bug" is found

Yale University, Office of the President: Biography of Grace Murray Hopper

πŸ› Finished!

In the app, this would earn you a sticker.

Download on the App Store
Keep readingAll articles β†’