Grace Hopper’s Computer Bug 1947: The Moth That Wasn’t Really the First

Grace Hopper computer bug 1947 is a story I’ve heard told, retold, and half-jokingly referenced in code comments for basically my entire career. Find a defect, call it a “bug,” someone in the room makes the moth joke, everyone nods, we move on. It’s the founding myth of my entire profession, told so casually and so often that I never once stopped to check whether it was actually true.

Turns out, researching this piece, that almost none of the details I’d absorbed over the years hold up cleanly. The word “bug” wasn’t coined that day. It wasn’t even close to new in 1947 — engineers, including Thomas Edison, had been using it for technical glitches for at least seventy years before anyone taped an insect into a logbook at Harvard. And Grace Hopper, the person the story is almost universally credited to, likely wasn’t even in the room when it happened.

I sat with that for a while, because it’s a specific kind of disappointment I recognize from every other “founding myth” story I’ve written about on this blog — Archimedes in his bathtub, Newton under his tree. The actual event turns out to be smaller, stranger, and more interesting than the legend. And in this particular case, the real story tells you something genuinely useful about how technical culture actually works, which the moth-and-eureka version completely misses.

Grace Hopper computer bug 1947 Harvard Mark II moth logbook

A Word That Was Already Seventy Years Old

Here’s the detail that reframes the entire story, and the one that gets left out almost every time this anecdote gets repeated.

“Bug,” as a term for a mechanical fault or technical glitch, predates the 1947 Harvard incident by decades. Thomas Edison himself used the word in written correspondence as far back as the 1870s, describing the small defects and unexpected faults that show up when you’re building something genuinely new. Engineers across multiple industries had been informally using “bug” this way for the better part of a century before the Harvard Mark II ever had a moth anywhere near it.

So the popular version of this story — that a literal insect gave the software industry its word for defects — has the causality backward. The joke that made the logbook entry funny in 1947 only worked because “bug” was already a familiar, slightly old-fashioned piece of engineering slang. Finding an actual bug, physically, inside the machine wasn’t the origin of a metaphor. It was a pun on a metaphor that had already been around long enough to feel a little tired.

I find this detail genuinely humbling in a way that goes beyond just “well, actually.” I’ve used the word “bug” thousands of times in my career without a second thought — filing bug reports, writing “fix bug” in commit messages, joking with colleagues about squashing one before a deadline. I never once wondered where the metaphor came from, or how old it actually was, because it had disappeared into the background of ordinary professional language so completely that it stopped feeling like a metaphor at all. It just felt like the word. That’s usually a sign that a piece of language has been around far longer than anyone using it realizes.


What Actually Happened on September 9, 1947

The real Grace Hopper computer bug 1947 story, setting the etymology aside, is still worth telling properly, because it’s a genuinely charming piece of engineering history even without the myth attached to it.

Setting the etymology aside, the actual documented event is still worth telling properly, because it’s a genuinely charming piece of engineering history even without the myth attached to it.

On the afternoon of September 9, 1947, a team working at Harvard’s Computation Laboratory was troubleshooting a fault in the Mark II Aiken Relay Calculator — an enormous electromechanical computer built from thousands of physical relays, essentially mechanical switches that clicked open and closed to perform calculations. Relays of this kind fail for all sorts of mundane physical reasons: dirt, dust, a stray piece of paper wedged in exactly the wrong spot.

The team unscrewed Panel F and began working through Relay 70. Inside, they found a moth — a real one, roughly two inches across, physically wedged between the electrical contacts, interrupting the current and causing the fault they’d been hunting. Someone pulled it out with tweezers, taped the insect directly onto the operations logbook, and wrote beside it: “First actual case of bug being found.”

That log page, moth and all, survives today in the collection of the Smithsonian’s National Museum of American History. It’s a genuinely wonderful artifact — a small, dry engineering joke, preserved by accident, that ended up outliving every single person who was in the room when it was made.

I think about that specific kind of documentation more than I probably should. Nobody on that team thought they were writing something historically significant. It was a logbook entry, meant to record a routine fix, made with enough of a sense of humor that someone bothered to tape the actual culprit to the page rather than just describing it in words. The most enduring pieces of technical culture are rarely created with any awareness that they’ll endure. They’re usually just someone’s small, private joke, made in a room that happened to get preserved.


Was Grace Hopper Even There?

Here’s where the story gets genuinely uncomfortable to research, because it involves quietly correcting a detail attached to someone whose actual, undisputed accomplishments deserve enormous respect.

Grace Hopper is almost universally credited as the person who found the moth, taped it into the logbook, and coined the term “debugging” as a direct result. She was, without question, part of the Mark II team at Harvard during this period — a mathematician working within the Navy’s computing program, who would go on to have one of the most consequential careers in the entire history of computer science. But the historical record on this specific incident is considerably murkier than the popular version suggests. The handwriting in the logbook doesn’t clearly match Hopper’s. Some historians who’ve examined the archive closely have concluded she likely wasn’t even present in the lab that particular day, and that the entry may have been made, and the moth taped in, by someone else on the team entirely.

What Hopper did do, unambiguously, is help popularize the story afterward — retelling it in later interviews, writing about it directly in a 1981 piece for the Annals of the History of Computing, and, through her enormous subsequent visibility in the field, becoming the name permanently associated with an anecdote she may not have personally authored.

I find myself genuinely torn about what to do with this fact, the same way I was torn writing about Rosalind Franklin’s Photo 51 or the more nuanced version of Archimedes’s bathtub. There’s a difference between “credit stolen” and “credit that accumulated, over decades, around whichever name in the room happened to become famous enough to attract it.” Hopper’s actual, well-documented achievements — her foundational work on compilers, her direct role in developing COBOL, one of the first high-level programming languages ever built for business use, her decades of service culminating in the rank of rear admiral in the U.S. Navy — are entirely real and entirely her own, verified many times over by people who worked alongside her. The moth story, by contrast, seems to be something closer to institutional folklore that settled onto her because she was the team’s most famous eventual member, not because the documentary evidence clearly places her at that specific relay on that specific afternoon.

As someone who has occasionally watched a piece of team history get simplified down to “the person everyone already knew was brilliant did the thing,” I recognize this pattern immediately. It’s not usually malicious. It’s just how institutional memory works — complexity gets sanded down, and credit tends to drift toward whoever’s name people already recognize, regardless of who was literally holding the tweezers.


The Word Everyone Actually Uses

What genuinely happened after September 9, 1947, regardless of who exactly wrote the logbook entry, is that “debugging” became the standard term for the process of finding and fixing errors in computer systems — not through any single dramatic announcement, but through gradual, informal adoption across the small, tightly connected community of early computer engineers, many of whom moved between the same handful of labs and projects throughout the 1940s and 1950s.

I use this word constantly, in a context that would have been completely unrecognizable to anyone on that Harvard team in 1947. I debug software running on hardware with more computational power than every computer that existed on Earth at the time combined. And yet the specific verb I reach for, dozens of times a week, traces directly back to a moth in a relay and a logbook entry that was, at its core, a joke about an already-old piece of slang.

There’s something worth sitting with in how completely that word has been absorbed into the profession. Nobody pauses before saying “I need to debug this” to consider that they’re invoking a seventy-plus-year-old insect pun. It’s not a metaphor anymore, in any live sense. It’s just the word. The most successful pieces of technical language, I think, aren’t the ones that stay clever. They’re the ones that get used so often, by so many people, for so long, that the cleverness wears off entirely and what’s left is just infrastructure — a word doing quiet, unglamorous work, the same way the relay itself was just supposed to click open and closed without anyone noticing it at all.


A Thought to Leave You With

What stays with me most about this story isn’t the moth, and it isn’t even the question of exactly who taped it to the page. It’s how much smaller and more ordinary the actual founding moment turns out to be, compared to the tidy origin story I’d been carrying around for years without examining it.

There was no single instant when someone looked at a computer bug and invented the whole concept from scratch. There was a seventy-year-old piece of engineering slang, already worn smooth from ordinary use, that got a literal, physical punchline one Tuesday afternoon in Cambridge, Massachusetts, recorded by someone whose name we’re not entirely sure of, in a logbook that happened to survive, at a lab that happened to include, among many other people, someone who would later become famous enough that the whole story gravitated toward her.

I think about this whenever I catch myself repeating some piece of professional folklore I’ve never actually verified — the origin of a term, the “real” story behind a famous outage, the person everyone credits with inventing something that, on closer inspection, probably had a messier, more collective, less photogenic history than the version that made it into circulation. Most of our field’s founding stories, I suspect, look something like this one, once you actually go looking: not false, exactly, but simplified down from something more collaborative and more ordinary into something that fits neatly into a single sentence and a single famous name.

The moth is real. It’s still there, taped to that page, sitting in a climate-controlled case at the Smithsonian, roughly two inches across, having done absolutely nothing except get stuck somewhere it shouldn’t have been on an ordinary afternoon in 1947. Everything else — the word, the joke, the name we attach to it — is the part we built afterward, the way we always do, to make a small, dry, slightly funny logbook entry into something we could tell each other for the next eighty years.


More Stories Like This

← Previous: Stephen Hawking’s Black Hole Paradox: Why Physicists Still Can’t Agree in 2026

→ Next: Coming soon