The Surprising Origin of the Word Bug in Computer Science and the Actual Moth That Started It
Discover how a literal moth found in a Harvard Mark II computer in 1947 forever cemented the term "bug" for software glitches, and learn the real history behind the word that predates programming.
Advertisement
The Surprising Origin of the Word Bug in Computer Science and the Actual Moth That Started It
Everyone in tech uses the word "bug" — a typo in your code, a broken API call, a mysterious crash at 3 a.m. It’s so ingrained that we rarely stop to think: why do we call it that?
The answer is stranger and more literal than you’d expect. It involves a moth, a Harvard Mark II computer, and a logbook that now lives in a museum.
Before the Moth: The Pre-History of "Bug"
The word "bug" wasn’t invented by programmers. Engineers used it for decades before the first electronic computer hummed to life.
In the late 1800s, Thomas Edison wrote in a letter about "bugs" in his inventions — meaning mysterious faults that took time to find. By the early 1900s, radio and telephone engineers regularly called any unexplained glitch a "bug." The term was already slang for "thing that’s wrong with the machine."
But in 1947, the meaning took a literal turn.
September 9, 1947: The Night the Moth Flew In
The Harvard Mark II was a massive electromechanical computer — think relays, switches, and vacuum tubes filling a room. On a warm evening in September, operators at Harvard University’s Computation Laboratory were debugging a problem. The machine kept malfunctioning.
Operator William "Bill" Burke opened Panel F, and there it was: a dead moth, trapped between the contacts of Relay #70. It had been blocking the electrical connection. They removed it with tweezers, taped it into the logbook, and wrote:
"First actual case of bug being found."
That logbook entry is legendary. It’s the first recorded physical bug in a computer. And because of that single moth, the word "bug" became forever tied to software and hardware glitches.
Wait — That’s Not the Origin of the Word
Here’s where the story gets tricky. Many people assume the moth invented the term "bug." That’s not quite right.
Grace Hopper — the brilliant computer scientist who worked on the Mark II — popularized the story in interviews for decades. She’d tell audiences about the moth and how they "debugged" the machine. Her charm and fame made the tale stick.
But Hopper herself acknowledged that "bug" was already in use. The moth just made it concrete. It turned an abstract engineering term into a literal, physical object you could tape into a book.
The Moth Today
That famous moth is still with us. It’s preserved in the logbook — now held by the Smithsonian National Museum of American History. Entry #1874, dated September 9, 1947, shows the carefully taped insect, with the note in ink underneath.
You can see a photo of it online. It’s a humble, brown moth — not a butterfly, not a beetle. Just a small creature that happened to land in the wrong place at the wrong time, and in doing so, cemented a term for all of computing.
Why This Matters
The bug story isn’t just trivia. It’s a reminder that our field has a very human, tactile history. Before we had Git and CI/CD pipelines, we had tweezers and logbooks. The "bug" was a real, physical thing you could find and remove.
Next time you’re tracking down a segfault or a race condition, remember that moth. You’re participating in a tradition that goes back to a room-sized machine and a tiny insect. And if you ever catch yourself saying "I need to debug this," you can smile — knowing exactly who (and what) started it all.
Advertisement
Comments
Questions, corrections, and tips stay visible for everyone reading this page.
Join the discussion
No comments yet
Be the first to leave a note — it helps the next reader.