A moth trapped inside a Harvard computer became one of technology’s most famous artifacts, but the real history of the “computer bug” began long before the insect was found.
THE UNIVERSAL RECORD
Sourced reporting. No opinions.
Brad Socha | September 8, 2026 | 5:07 AM EST
On September 9, 1947, engineers working with the Harvard Mark II computer encountered an unusual Bug. A moth had become trapped among the machine’s electromechanical components.
The insect was removed and taped directly into the computer’s logbook. Beside it, someone recorded a line that would become famous in computing history: “First actual case of bug being found.”
The moth was real. The logbook survives. But the popular story that this incident created the term “computer bug” is not accurate.
Engineers had been using “bug” to describe technical problems for decades. Thomas Edison used the word in connection with difficulties in electrical systems as early as the 19th century. What happened at Harvard was memorable precisely because the engineers encountered a literal bug.
It was an engineering joke that became part of computer history.
The Bug Inside the Mark II
The Harvard Mark II was an enormous electromechanical calculating machine developed under the direction of mathematician Howard Aiken and built for the U.S. Navy.
Unlike modern computers built around microscopic electronic components, the Mark II depended heavily on electromechanical relays, switching devices that physically opened and closed electrical circuits. These components made the machine powerful for its era but also created countless places where mechanical or electrical problems could interrupt its operation.
On September 9, engineers investigating the machine found the moth caught at Relay No. 70 in Panel F.
They removed it carefully enough to preserve the insect and attached it to the day’s logbook with tape.
The handwritten comment beside it transformed an otherwise routine maintenance problem into an enduring piece of technological folklore.
Grace Hopper is frequently described as the person who discovered the moth. The historical record is less certain.
Hopper, a mathematician and U.S. Navy officer who became one of the most important pioneers in computer programming, was working with the Harvard computing team during this period. The Smithsonian’s National Museum of American History notes that the logbook was probably not Hopper’s and attributes the discovery more generally to engineers working on the Mark II.
Hopper nevertheless played an important role in preserving and popularizing the story. She later recalled the incident when discussing early computing, helping the moth become closely associated with her remarkable career.
The distinction matters because the surviving artifact allows the familiar legend to be separated from what can actually be established.
Computer Bug: A Term Older Than Computers
The moth also did not give technology the word “bug.”
The Smithsonian notes that American engineers had been referring to small flaws in machinery as bugs for more than a century and that Thomas Edison discussed bugs in electrical circuits during the 1870s.
By the time programmable computers appeared in the 1940s, describing a hardware or programming problem as a bug was therefore not an entirely new concept.
That makes the wording in the Mark II log particularly revealing.
The engineers did not write that they had discovered a new term. Instead, they called the moth the first “actual” case of a bug being found.
The joke depended on everyone already understanding what a technical bug meant.
“Debugging” similarly became embedded in the language of computing as programmers and engineers searched for and corrected problems in machines and their instructions.
The terminology survived enormous technological change.
The Mark II belonged to an era of large electromechanical machines. Modern computers contain billions of transistors on sophisticated processors, while contemporary software can consist of millions of lines of code distributed across devices, data centres and networks.
Yet programmers still talk about bugs.
Software developers debug applications. Engineers investigate bugs in operating systems. Cybersecurity researchers discover bugs that can become vulnerabilities. Artificial intelligence systems introduce new varieties of technical failures requiring investigation, testing and correction.
The machines changed almost beyond recognition.
The language did not.
The Moth That Survived
What makes the 1947 incident particularly remarkable is that the physical evidence still exists.
The original Mark II logbook, with the moth still attached to its page, eventually entered the collection of the Smithsonian’s National Museum of American History after being transferred from the U.S. Navy.
The museum identifies the artifact as a 1947 computer logbook and preserves the insect along with the handwritten entry.
It is difficult to imagine a more literal artifact from the history of computing: an actual insect preserved beside a joke about a technical problem, recorded at a time when digital computing itself was still in its infancy.
Grace Hopper’s career would extend far beyond the moth story. She became a major figure in the development of programming languages and compilers and later achieved the rank of rear admiral in the U.S. Navy.
But the incident at Harvard remains one of computing’s most recognizable origin stories.
Not because a moth invented the computer bug.
It did something more unusual.
For one day in 1947, a figure of speech became real.
Sources:
Smithsonian National Museum of American History — Log Book With Computer Bug
https://americanhistory.si.edu/collections/object/nmah_334663
Smithsonian National Museum of American History — Grace Under Pressure
https://www.americanhistory.si.edu/explore/stories/grace-under-pressure
Naval History and Heritage Command — The First “Computer Bug”
https://www.history.navy.mil/our-collections/photography/numerical-list-of-images/nhhc-series/nh-series/NH-96000/NH-96566-KN.html
Naval History and Heritage Command — Rear Admiral Grace Hopper
https://www.history.navy.mil/content/history/nhhc/browse-by-topic/people/namesakes/grace-hopper.html
About the Author
Brad Socha is the founder of The Universal Record, focused on sourced, factual global reporting. Coverage includes international news, geopolitics, technology, and major developments.

