The moth was about an inch long, dead, its wings still intact when the operators of Harvard’s Mark II Aiken Relay Calculator found it wedged inside Panel F, between the contacts of Relay #70, at 15:45 hours on September 9, 1947. Someone on the night shift pulled it out with tweezers, reached for a roll of Scotch tape, and pressed the insect flat against the page of the laboratory logbook. Above the specimen, in tidy engineer’s print, ran the line that has been quoted in computer science classrooms ever since: First actual case of bug being found.
The logbook is now at the Smithsonian’s National Museum of American History. The moth is still taped to the page.
Grace Hopper, then a 40-year-old reserve naval officer and mathematician on the Mark II team, would tell this story for the rest of her career. She told it at conferences. She told it on talk shows. She told it to admirals. By the time she died in 1992 as a retired Rear Admiral, the moth had become the founding parable of an entire profession. The moment, the story goes, that the word bug entered the vocabulary of computing.
The story is true. Just not in the way most people tell it.

The Harvard basement, September 1947
The Mark II was not a computer in the modern sense. It was a 25-ton electromechanical calculator built for the US Navy’s Bureau of Ordnance to compute ballistics tables, housed in a basement at Harvard, and operated by a small team that included Hopper, William Burke, and a handful of Navy technicians. It ran on roughly 13,000 relays, small electromagnetic switches that physically opened and closed to represent ones and zeros. Each relay clicked. The room sounded like a knitting factory.
On the afternoon of September 9, the machine started producing wrong answers. The crew began the slow process of tracing the fault from panel to panel, relay to relay, until they reached Panel F. Somewhere between the contacts of Relay #70, a moth had been crushed by the closing switch and was holding the circuit open. The operators removed it, taped it in, and went back to work. The machine ran clean afterward.
What is almost always misattributed is the handwriting. Hopper was on the team. Hopper was not the one who found the moth, and Hopper did not make the log entry. The technicians on duty did. She watched, she remembered, and she told the story for the next 45 years until the story belonged to her.
The word was already old
The most important detail in the logbook is the word actual. First actual case of bug being found. The joke only lands if the word bug already meant something to the people reading the page. And it did. As Computerwoche notes in its history of the term, engineers had been calling mechanical faults “bugs” for at least seventy years before the Mark II crew taped an insect into a logbook.
Thomas Edison used the word in a letter to Theodore Puskas in 1878, complaining about the slog of getting a new invention to work:
‘Bugs’ — as such little faults and difficulties are called — show themselves and months of intense watching, study and labor are requisite before commercial success or failure is certainly reached.
Edison was writing about the phonograph and the incandescent bulb. He was using the word the way a Harvard relay technician would use it in 1947, as shop-floor shorthand for whatever small, irritating, hard-to-find thing was keeping the machine from working. Etymologists trace it further back, to an old English word for a monster, surviving in the strange compounds bugaboo, bugbear, and, after a few centuries of corruption, boogeyman. A bug was something that hid in the dark and ruined your work.
Why the wrong version of the story stuck
The myth that Hopper coined the word in 1945 — the date is wrong by two years; the Mark II didn’t exist in 1945 — has outlived every correction. The reason is not carelessness. It is the way technical fields build their own founding myths.
Naming a thing changes how a profession thinks about it. A single documented instance can lock in terminology for decades, because the artefact (the logbook page, the photograph, the patent) gives the word a fixed location in time. Before September 9, 1947, programmers had been finding bugs. After September 9, 1947, programmers could point at a specific moth in a specific logbook and say: here is what we mean.

What “debugging” actually meant to do
The Mark II crew were doing something more interesting than swatting an insect. They were inventing the cognitive routine that every modern programmer still performs without thinking about it.
The routine has a shape. The machine misbehaves. You form a hypothesis about which subsystem is responsible. You test the hypothesis by isolating the subsystem. You either narrow the search or eliminate it and move on. You repeat until you find the offending component, fix it, and verify the rest of the system still works. This is the same method a Harvard technician used to trace a calculation error through 13,000 relays to a single dead moth, and it is the same method a modern engineer uses to find a null pointer in a million lines of TypeScript.
The procedure maps closely to the kind of mathematical reasoning strategies psychologists describe for handling complex problems: shrink the problem until you can see it, identify the pattern, reverse-engineer from the desired outcome. Hopper’s contribution was not the word. It was the insistence that this kind of careful, ego-free fault-tracing was a real form of intellectual work. Finding the bug was as important as writing the code.
The Hopper effect
By the time Hopper died at 85 in 1992, having been recalled to active Navy duty twice and promoted to Rear Admiral, she had spent four decades evangelising a single, deeply contrarian idea: that computers should be programmable in something close to English, not in raw machine code. She designed the first compiler. She led the team that developed FLOW-MATIC, the direct ancestor of COBOL, the business language that ran the world’s banks and airlines well into the 21st century.
The moth story was a teaching tool. She used it to make a room of admirals understand that a computer error was not mystical. It was an actual, physical, locatable thing, the kind of problem you could put tweezers around. As one history of the episode puts it, the moth story is true even if the moth was not the actual origin of the word, and Hopper is the figure who did the most to popularise it. The Navy named a destroyer after her. The USS Hopper, DDG-70, is still in service.
How a logbook entry shapes a profession
The moth itself has been on display, off and on, at the Smithsonian since the 1990s, with the original page from the Mark II logbook beneath it. School groups stop in front of it. Most of the children have no idea what a relay is. The story works anyway, because the story is doing something the underlying technology can’t.
Founding artefacts give a profession a story it can tell about itself. The first ARPANET message was supposed to be LOGIN and arrived as LO because the system crashed. The first email was sent on a desk in Cambridge, Massachusetts. The first computer bug was a moth in a relay in Harvard’s basement. Each of these stories is partly mythologised, partly true, and entirely useful, because they give a young engineer something to point at when she wants to explain what she does for a living.
The most durable of these stories tend to be the ones built around a physical object and a specific time. The moth in Panel F has both. There is a date. There is a relay. There is the insect itself, taped to a page, on display.
The 78-year trail
Every modern programming environment carries some descendant of that logbook entry. Visual Studio has a Debug menu. Chrome has DevTools. Python has pdb. The job title “software engineer” was not in widespread use in 1947, but the verb “debug” was already a fixture of the engineering vocabulary within a decade. By the 1960s it had crossed into general English. By the 1990s it had crossed back into other fields. Biologists debug experimental protocols. Screenwriters debug second acts.
So here is the awkward question the moth raises, and the reason the wrong version of the story keeps winning. Tech does not remember its history. It curates it. A profession that prides itself on precision, on reproducibility, on the audit trail, has cheerfully spent 78 years crediting the wrong person for a word she did not coin, on a date that is off by two years, attached to an event she did not perform. Not because anyone is lying. Because the version with Grace Hopper and the moth is simply a better story than the version with an anonymous night-shift technician and seventy years of prior usage.
That is the actual lesson of Panel F, and it is not flattering. Every industry builds its origin myths by quietly editing out the people who did the work and the words that were already in circulation, and then defending the edit as folklore. The moth is real. The handwriting is real. The Scotch tape has yellowed in exactly the way you would expect. What is fictional is the idea that engineers, of all people, can be trusted to tell the truth about where their language came from. Ask which other founder stories you have been repeating without checking. The answer is most of them.