If you have ever frozen mid-deadline, watched your laptop throw a fit, and told whoever was listening that the thing has a bug, you have used one of computing's oldest words without a second thought. We call glitches bugs. We debug our programs. We say it so often that it feels like the word must have been born the same week as the transistor. But here's the secret, though: it wasn't. The true origin of "bug" is older, stranger, and a lot funnier than the story everyone tells. Buckle up — this one has chapters.
Chapter One: The Moth Everyone Remembers
The version you have probably heard goes like this. It is September 9, 1947. A team at Harvard University is running the Mark II, a giant, room-sized calculator working for the U.S. Navy. Suddenly the machine starts spitting out wrong answers. The engineers dig in — and inside Relay 70, Panel F, they find the culprit: a moth, flattened between the contacts. They tape the insect into the logbook and pencil beneath it: "First actual case of bug being found." That logbook, moth and all, now sits in the Smithsonian National Museum of American History.
The star of the story is usually Grace Hopper, the legendary computer scientist who would rise to Rear Admiral and help pioneer the first compilers. She told the moth tale for decades — at conferences, in classrooms, on television — until it became the official origin story of every glitch in tech history. Ask almost anyone how the computer bug got its name and they will happily tell you about the moth. Which makes the next part even better.
Chapter Two: The Twist Nobody Expects
Here's the thing the moth story leaves out: the word bug was already wandering the engineering world decades before 1947. The clearest proof is a letter written in 1878 by Thomas Edison — yes, that Edison — to a friend named Theodore Puskas. Complaining about the delays every inventor knows, Edison wrote:
"Bugs" — as such little faults and difficulties are called — show themselves, and months of anxious watching, study and labor are requisite before commercial success — or failure — is certainly reached.
Edison even named a device he built to smooth out faults in his telegraph a bug trap. So when the Harvard crew found a moth jammed inside a relay in 1947, the word "bug" didn't take its meaning from the insect — the insect was a walking, buzzing, very literal pun. Read that logbook note again: "First actual case of bug being found." It only lands as a joke if you already know what a "bug" means. It is engineer humour, the way you might say you finally caught the gremlin that has been hiding in the engine. You can only pull that punchline off if you already believed in gremlins.
Chapter Three: Where "Bug" Really Comes From
So if computers did not invent the bug, who did? Language did. The word travels back through English to an old name for a monster or a goblin — the same root that gives us bugbear, the frightening thing hiding under the bed, bugaboo, and even, in a mangled form, boogeyman. For centuries, people who watched machines fail for no visible reason blamed invisible creatures meddling inside. "Bug" was the word for that phantom. When telegraph engineers in the 1800s hit faults they could not see, they reached for the same word a farmer used for a broken tool: must be a bug. And debugging? Same idea — hunting the invisible monster until it is gone. The moth did not invent those words. It just finally gave the gremlin a face.
The Honest Caveat
Now, for the record: historians are not certain about every detail of this one. The Smithsonian notes the logbook was probably not even Hopper's — someone else on the team likely found the moth and made the note. What is certain is that Hopper made the story famous, retelling it so often that the moth turned into computing's favourite folklore. A fair outcome, too, because her real contribution to computing was no myth: her compilers and programming languages genuinely changed how the world writes code. She simply understood a good story when she saw one.
So Next Time You Hit a Bug...
So the next time your phone throws a mysterious error right before your alarm — or your favourite app decides to take an unscheduled holiday — you will be in on the secret. The word "bug" was already a century old when the moth got its fifteen minutes. It began as a name for monsters, haunted the workshops of Victorian inventors, got picked up by the first generation of computer engineers, and then starred in one of technology's best-loved tales. There is something quiet and comforting in all of it: even our most modern machines still hide a little imaginary monster inside. Somewhere, a moth with an oversized name is still grinning about it.