At 3:45 in the afternoon on September 9, 1947, a team of engineers working on the Harvard Mark II computer were trying to figure out why the machine was malfunctioning.
The Mark II was a beast — an electromechanical computer the size of a room, built for the United States Navy, full of thousands of mechanical relays that clicked open and closed to perform calculations. When something went wrong, you couldn’t check the code. You had to physically inspect the hardware.
Inside Relay #70, Panel F, the engineers found their problem.
A moth. A dead one. Stuck between the relay contacts, exactly where it shouldn’t be, preventing the relay from closing properly. They removed it. The machine started working again.
What happened next is why we remember the story.
Somebody on the team taped the moth into the official logbook. Underneath it, they wrote: 15:45 Relay #70 Panel F (moth) in relay. First actual case of bug being found.
That logbook page, with the moth still taped to it after seventy-eight years, is one of the most quietly funny artefacts in the history of computing. It’s currently held at the Smithsonian’s National Museum of American History.
Why the note is funnier than people realise
The story is usually told as if this incident is where the word bug came from in computing. It isn’t.
Engineers had been calling glitches “bugs” for at least sixty years before this moth turned up. The Oxford English Dictionary traces the engineering use of bug back to the 1870s. Thomas Edison wrote about “bugs” in his inventions in an 1878 letter, complaining that getting a new invention working required hunting down all the little bugs inside it.
By 1947, calling a hardware fault a bug was completely standard engineering slang.
Which is what makes the logbook note so good. First actual case of bug being found — emphasis on actual — is a deadpan joke. The engineers had been calling abstract glitches “bugs” for decades, and now, for the first time, they had a literal bug to point at. The joke only lands if you know the word was already in heavy use.
The moth didn’t invent the word. The moth made fun of the word, by being an unusually literal example of it.
That’s why somebody bothered to tape it into the logbook. They thought it was funny.
Why this entry survived when nothing else did
Computer engineering teams keep logbooks. Most of those logbooks are stunningly boring — line after line of timestamps and error codes from operators on different shifts.
The Mark II logbook from 1947 is not stunningly boring. It’s a working record of a team building one of the first programmable electronic computers, full of the day-to-day frustrations of getting an enormously complex new machine to behave. And in the middle of it, on the page dated September 9, somebody taped a moth.
The page got passed down because of the joke. It got photographed because of the joke. It got preserved because of the joke. Without the moth, it would have been one more line of 1940s computer maintenance. With the moth, it became the most photographed page in the entire history of early computing.
How Grace Hopper became attached to the story
The other thing the popular retelling usually gets wrong is who actually found the moth.
Grace Hopper was on the Mark II team in 1947. She was already a remarkable mathematician and would later become a Navy rear admiral and one of the most important figures in the history of computer programming. But the September 9 logbook entry doesn’t appear to have been written by her, and she may not have been the person who actually pulled the moth out of the relay.
What Hopper did, decades later, was tell the story. She told it brilliantly. Through years of lectures and interviews, she made both the incident and the moth-as-bug joke famous until the story became inseparable from her name.
That’s how a lot of historical anecdotes work. The person who lived the moment isn’t always the one who immortalises it. Hopper didn’t claim credit for finding the moth — she was careful about that. But she made sure the rest of the world knew the moth had existed, and what the joke meant.
What you can actually see at the Smithsonian
The logbook isn’t always on public display. It’s part of the National Museum of American History’s collection and gets rotated in and out of exhibitions on the history of computing.
When it is on display, it’s exactly what you’d hope for. A worn page from a 1940s engineering notebook. A small dead moth, taped neatly into place. And underneath, in the handwriting of an engineer who has now been dead for decades, a joke that’s still funny.
The moth itself is roughly two inches across. Grey and brown. It looks, frankly, like any moth that might fly into your kitchen tonight.
The fact that this one happened to fly into the wrong relay at the wrong time, in a room full of engineers with a sense of humour, is the reason millions of people in 2026 still use the word debug without quite knowing where it comes from.
The actual bug is still there. In a drawer in Washington. Almost eighty years old. The most successful insect in the history of computing.
