On September 9, 1947, at precisely 3:45 PM, engineers working on the Harvard Mark II computer noticed something was wrong with Relay #70 on Panel F. The relay — an electromechanical switch that physically clicks open and closed — was stuck. They opened it and found a moth wedged between the contacts, preventing them from closing.
They removed it with tweezers, taped it into the logbook, and wrote underneath: "First actual case of bug being found."
That logbook, moth still attached, is in the Smithsonian National Museum of American History today. You can look it up: object number NMAH 334663.
The popular version of this story says Grace Hopper found the moth and coined the term "computer bug." Both parts are slightly wrong — and the real version is better.
The Smithsonian itself notes that the logbook was probably not Hopper's, based on handwriting analysis. She worked on the Mark II team, and she later helped make the story famous, but the actual finder was likely engineer William B. Burke or another colleague. Hopper published the anecdote in 1981 in the Annals of the History of Computing, and it became legend.
More importantly: the engineers were already using the word "bug" when they wrote that note. It was a joke — they had found a literal bug in a machine, using a term that was already decades old. Thomas Edison wrote in an 1878 letter: "Bugs, as such little faults and difficulties are called, show themselves." By 1934, Webster's dictionary included "bug" as a term for mechanical defects. WWII radar engineers used it constantly.
For comparison, here is the real timeline of "bug":
- 1878: Edison uses "bug" for technical faults in writing
- 1934: Webster's dictionary includes the engineering meaning
- 1945: "Debug" appears in an engineering journal
- 1947: The moth is found — a joke, not an invention
- 1981: Hopper publishes the story; it goes viral (slowly)
- Today: The moth is in the Smithsonian; the term is everywhere
The moth didn't create the word. But it gave the word a face. A small, dead, taped-to-a-page face that turned an engineering term into a universal one.
The next time your code won't run, remember: the original debugging involved tweezers, a dead moth, and a piece of tape.