The First Computer Bug Was an Actual Bug: The 1947 Moth That Named a Phenomenon
March 28, 2026 · 4 min read
The Fact
The first computer bug was an actual bug — a moth found trapped in a relay of the Harvard Mark II computer in 1947.
The Day the Logbook Became History
The Harvard Mark II was a massive electromechanical computer occupying an entire room at Harvard University. It performed calculations using physical relays — electromagnetic switches that opened and closed to represent binary values — rather than the electronic vacuum tubes or transistors of later computers. On September 9, 1947, the machine began producing incorrect outputs. Technicians tracing the fault found the cause in Relay 70, Panel F: a moth had become trapped between the contacts, preventing the relay from operating correctly.
They removed the moth, taped it into the computer's operations logbook, and wrote: "1545. Relay #70 Panel F (moth) in relay. First actual case of bug being found." The logbook is now preserved at the Smithsonian Institution's National Museum of American History. The entry is written in a matter-of-fact tone — this was one item among many routine log entries for the day — with no apparent awareness that the moth would become one of the most cited objects in computing history.
Grace Hopper and the Popularization
The logbook entry is often attributed to Grace Hopper, one of the most important figures in the history of computing, who was working on the Mark II project at the time. Hopper herself promoted the story frequently in later years and the popular image of her discovering the moth has become part of computing folklore. More careful historical investigation suggests that while Hopper was present, the actual logbook entry was likely written by another team member. She did not claim to have personally made the discovery but consistently used the story to explain the term "debugging" to audiences.
Hopper's broader contribution to computing was immense regardless of her precise role in the moth incident. She was a pioneer of machine-independent programming languages, led the development of COBOL, and spent decades as one of the most effective communicators about the emerging field of computer science to non-specialist audiences. The moth story served her pedagogical purpose well because it made the abstract concept of software errors tangible and memorable.
The Word "Bug" Predated the Moth
The use of "bug" to describe a technical problem predates the 1947 moth by decades. Thomas Edison used it in the 1870s and 1880s to refer to faults in his inventions, writing about "bugs" in his electric light systems. The word was common in engineering slang throughout the early 20th century. The 1947 logbook entry says "first actual case of bug being found" — the word "actual" acknowledging that the term was already in use figuratively before a literal bug had been encountered.
What the Harvard Mark II moth accomplished was not the coining of the word "bug" but the creation of an origin story — a vivid, concrete, and memorable explanation for where the metaphor came from that made the term feel inevitable. When people now say "there's a bug in the software," there is a direct conceptual line back to that moth in the relay, even if the etymological line is more complicated.
The Legacy in Modern Computing
Software "debugging" — the process of finding and fixing errors in code — remains one of the most time-consuming and intellectually demanding aspects of software development. Modern programs contain millions of lines of code, and bugs can arise from interactions between components that function correctly in isolation but produce unexpected behavior in combination.
The moth that ended up in Relay 70 of the Harvard Mark II on September 9, 1947 could not have contributed to computing history by any intention of its own. But it has been contributing ever since — taped to a page in the Smithsonian, a physical artifact of the exact moment when the metaphorical and the literal converged in the most literal way imaginable.
FactOTD Editorial Team
Published March 28, 2026 · 4 min read
The FactOTD editorial team researches and verifies every fact before publication. Our mission is to make learning effortless and accurate. Learn about our process →