It's one of the most charming stories in computer history. A room-sized computer stops working, engineers go hunting for the problem, and they find an actual insect stuck inside. From that day on, the story goes, computer glitches were called bugs. So is that really where the word came from?
The short answer is that the moth was real, but it wasn't the origin of the word. In about 1947, operators of the Harvard Mark II computer found a moth trapped in a relay and taped it into their logbook with the note "First actual case of bug being found." But engineers had already been calling defects bugs since at least the 1870s. The note was most likely a joke playing on a word they already knew.
The Moth in the Machine
The Harvard Mark II was an enormous electromechanical computer, completed in 1947 and paid for by the U.S. Navy. It weighed about 25 tons and filled more than 4,000 square feet. Instead of modern chips, it ran on thousands of electromagnetic relays, little switches that clicked open and closed.
When the machine started making errors, the operators traced the problem to a moth caught in one of those relays. They removed it and taped it onto the log sheet for that day. That logbook, complete with the moth, is now in the collection of the Smithsonian National Museum of American History.
Why the Word Was Already Old
Look closely at that famous note: "First actual case of bug being found." The word actual is the giveaway. The operators were familiar with bug as an engineering term and were probably making a pun, pointing out that this time the bug was a literal insect.
Thomas Edison used the word back in 1878. In a letter to an associate, he described how, after an invention's first burst of inspiration, "Bugs"—as such little faults and difficulties are called—show themselves. In 1924, a telephone industry journal printed a comic that joked a "bug hunter" was just a nickname for a repairman. In 1931, the first mechanical pinball game was advertised with the slogan "No bugs in this game!" And Isaac Asimov used the term for robot troubles in a 1944 story.
Grace Hopper's Favorite Story
The moth story became famous largely thanks to Grace Hopper, a computer pioneer and U.S. Navy rear admiral who worked on the Mark II. She loved to tell it, and she's often linked with it, though it was her associates who actually found the insect.
Hopper deserves her fame for much bigger reasons. She was one of the first programmers on the Harvard Mark I, is credited with writing the first computer manual, and is often credited with creating the first compiler, a program that translates human-friendly code into machine instructions. Her work strongly influenced COBOL, an early programming language that's still in use today.
She also had a playful streak. Hopper kept a clock on her wall that ran backward to remind people not to cling to "We've always done it this way."
Still a Great Story
So the moth didn't invent the word bug. But it may be the most famous bug ever found, and it's a reminder that early computers were physical machines, full of moving parts where a stray insect could cause real trouble. Not a bad legacy for one unlucky moth.





