FactOTD

The Original Computer Bug Was an Actual Bug: The Story Behind the Term

March 28, 2026 ยท 4 min read

The Fact

The concept of a 'bug' in computing was popularized in 1947 when a real moth was found jammed in a relay of the Harvard Mark II computer.

The word "bug" to mean an engineering defect long predates computers. Thomas Edison used it in an 1878 letter to describe problems in his phonograph: "It has been just so in all of my inventions. The first step is an intuition, and comes with a burst, then difficulties arise โ€” this thing gives out and [bugs] โ€” as such little faults and difficulties are called โ€” show themselves." Engineers had been using the term informally for decades before any computer existed.

But the specific association between "bug" and computer errors โ€” the usage that most people know today โ€” was crystallized by an incident in September 1947 at Harvard's Computation Laboratory, and by the logbook entry it produced.

The Moth and the Mark II

The Harvard Mark II was an electromechanical computing machine โ€” a large, room-filling device that used electromagnetic relays to perform calculations. Relays are mechanical switches that open and close electrical contacts when a coil of wire is energized. Unlike the vacuum tubes used in contemporary electronic computers, relays are physical mechanisms with moving parts โ€” and moving parts can be jammed by foreign objects.

On September 9, 1947, technicians working on the Mark II found that the machine was producing calculation errors. Investigating the malfunction, they traced it to Relay Number 70 in Panel F. Inside the relay, they found a moth, apparently attracted to the heat of the machine, which had been crushed between the relay contacts and was causing intermittent electrical failures.

The technician removed the moth, taped it into the operational logbook, and wrote beside it: "First actual case of bug being found." The log entry was written, by most accounts, with a degree of humor โ€” the phrase "first actual case" plays on the dual meaning of bug (insect versus defect), suggesting the writer was aware of the pre-existing slang usage and enjoying the coincidence that the metaphorical bug was, on this occasion, a literal one.

Grace Hopper and the Story's Legacy

The logbook page with the moth was preserved, and the story became associated particularly with Grace Hopper, a Navy officer and pioneering computer scientist who worked on the Mark II and later became one of the most influential figures in computing history. Hopper did not find the moth herself, but she was present at the time and frequently recounted the story in later years, helping cement it in computing folklore.

Hopper's association with the story is fitting beyond the coincidence of proximity. She is better known for her work on compiler technology โ€” she led the team that developed the first practical compiler, a program that translates high-level programming language into machine code โ€” and for her advocacy for programming languages that used English-like commands rather than binary or assembly. Her FLOW-MATIC language was a direct precursor to COBOL, one of the first widely used business programming languages.

The original logbook page is preserved at the Smithsonian National Museum of American History, where it sits with the moth still taped to it, an artifact of the moment when an engineering metaphor became literal.

The Taxonomy of Modern Bugs

The word "bug" has been so thoroughly absorbed into computing culture that it has spawned a rich vocabulary. A programmer who removes bugs "debugs" their code; the tools used to step through running code and identify problems are called "debuggers"; the process of structured bug removal is called "debugging." Software companies have "bug trackers" and "bug bounty programs" that pay researchers for finding security vulnerabilities. The severity of a bug is categorized in systems that range from "minor annoyance" to "critical: system crash" to "security vulnerability."

The moth in Relay 70 caused a computation error in a single machine that could be fixed by removing it. Modern software bugs can corrupt financial transactions across millions of accounts, ground entire airline fleets, expose sensitive medical records, or โ€” in the most severe cases โ€” enable attackers to gain control of critical infrastructure. The stakes have changed; the vocabulary traces back to a moth that flew too close to a relay on a late-summer night in Massachusetts in 1947.

F

FactOTD Editorial Team

Published March 28, 2026 ยท 4 min read

The FactOTD editorial team researches and verifies every fact before publication. Our mission is to make learning effortless and accurate. Learn about our process โ†’

Related Articles

technologyThe First Computer Bug Was an Actual Bug: The 1947 Moth That Named a PhenomenonOn September 9, 1947, a moth was found trapped in Relay 70 of the Harvard Mark II computer. Technicians taped it into their logbook with the note 'first actual case of bug being found.' The word 'bug' to describe technical problems already existed, but this moment gave the term its definitive, legendary origin story.technologyThe First Internet Message Was 'LO' โ€” Because the System Crashed After Two LettersThe first message ever sent over the network that would become the internet was supposed to be 'LOGIN.' Instead it was 'LO' โ€” because the receiving computer crashed after two characters. The accidental poetry of that truncated greeting, inadvertently echoing 'hello' or 'lo and behold,' seems fitting for the birth of the technology that would eventually connect most of humanity.technologyCloud Computing Was Predicted in 1961 โ€” Long Before the Internet ExistedIn April 1961, at MIT's centennial celebration, a mathematician named John McCarthy suggested that 'computation may someday be organized as a public utility.' He made this prediction a decade before the internet, three decades before the World Wide Web, and four decades before Amazon Web Services would make it a commercial reality. The idea was so far ahead of its time that it had to be reinvented independently by a new generation of engineers before the technology could support it.technologyENIAC: The 30-Ton Computer That Launched the Digital AgeIn 1945, a machine filled an entire room, weighed as much as a loaded semi-truck fleet, and drew so much power it reportedly dimmed the lights of an entire Philadelphia neighborhood when switched on. It was called ENIAC โ€” and it could perform 5,000 additions per second, making it the fastest calculator in the world.