The Actual Moth in the Machine: Grace Hopper and the First Recorded Computer Bug
A moth taped into a 1947 logbook is one of computing's most-repeated stories — and one of its most-garbled. Here's what the primary source, the logbook itself, actually shows.
A logbook page, a piece of tape, and an actual dead moth — the physical artifact behind one of computing’s most-told anecdotes is still preserved today at the Smithsonian’s National Museum of American History, and it’s more precise, and more limited, than the popularized version of the story usually suggests.
What actually happened
On September 9, 1947, engineers working on the Harvard Mark II relay-based computer at Harvard University found a moth trapped in Relay #70, Panel F, causing a malfunction. The team removed the moth, taped it into the operations logbook, and wrote beside it: “First actual case of bug being found.”
Grace Hopper’s actual role
Grace Hopper, then a Naval officer and mathematician working on the Mark II team, did not personally find the moth, and the Smithsonian’s own description of the logbook notes it “was probably not Hopper’s” handwriting on that specific page. Hopper’s genuine, well-documented role was in helping popularize and repeat the story afterward, and in her broader, substantial career contributions to programming and compiler design in the years that followed.
The part of the popular story that’s actually wrong
The popularized version often credits Hopper with coining the terms “bug” and “debugging” via this exact incident. In reality, “bug” as engineering slang for a defect predates this event by decades — Thomas Edison used the term in written correspondence as early as the 1870s to describe technical glitches in his own inventions. What made the 1947 moth incident notable wasn’t inventing the term, but providing a literal, physical, wonderfully on-the-nose instance of it that stuck in institutional memory (and eventually popular culture) specifically because a real insect was involved.
Why the distinction is worth making at all
This isn’t a pedantic correction for its own sake — it’s a useful illustration of how technology folklore evolves: a genuinely interesting, well-documented event (a literal bug causing a literal malfunction, recorded in a primary-source logbook you can still view today) gets retold with an appealing but inaccurate embellishment (that this is where the terminology originated) layered on top, until the embellishment becomes as well-known as the real event underneath it.
What the primary source actually settles, and doesn’t
The logbook page itself — a primary source, not a retelling — settles what happened at Harvard that day beyond reasonable dispute. It says nothing at all about the broader etymology of the word “bug” in engineering, which is a separate historical question the logbook was never claimed to answer, however often the two get conflated in the retelling.