The “Bug” in a Computer Was a Bug—but Not the First One
The word bug was already used for a flaw in a machine long before electronic computers existed. In the 19th century, inventors and engineers used it informally for a defect that interfered with a device’s operation. The exact path by which the term entered technical slang is unclear, but it was not coined by a computer team.
A Moth Made the Word Memorable
In 1947, operators investigating a problem with the Harvard Mark II, an early electromechanical computer, found a moth trapped in one of its relays. A relay is an electrically controlled switch; a moth caught between its contacts could keep the switch from working properly. The team taped the insect into its logbook and noted it as the “first actual case of bug being found.”
That entry gave the older expression a vivid, literal illustration. Grace Hopper, a computer pioneer who later helped popularize the story, was associated with the Mark II team, but the moth episode did not create the word bug.
From Literal Insect to Everyday Error
As computers became more complex, their faults were often invisible: a miswired connection, a faulty component, or an error in instructions could produce the same kind of trouble as the moth did. Engineers kept calling such faults bugs, and the process of finding and fixing them became known as debugging.
The story stuck because it neatly captures the idea: sometimes a machine fails because something has gone wrong inside it—even if the culprit is not an insect.






