
Before computer bugs became invisible, one malfunction could be picked up with tweezers, stuck in a logbook, and preserved for history.
At 3:45 p.m. on September 9, 1947, one of the world’s most advanced calculating machines encountered an adversary for which its designers had written no protocol. It was not a misplaced equation or some mysterious error in the program. Inside relay number 70 on Panel F of the enormous Harvard Mark II, a moth had become trapped between the metal contacts.
One of the operators removed it with tweezers, placed it on a page of the official logbook and secured it with clear adhesive tape. Beneath it, someone wrote: "First actual case of bug being found." The story is often retold as the moment the word bug was invented and as a personal discovery by Grace Hopper. Neither claim is entirely true. That is precisely what makes the real story even better.
The machine that calculated in clicks
The Harvard Mark II, officially known as the Aiken Relay Calculator, was developed under the direction of American physicist and computing pioneer Howard Aiken. It was funded by the US Navy for use at its proving ground in Dahlgren, Virginia. In September 1947, it was still being tested at Harvard in Cambridge before being transferred to Dahlgren.

The Mark II had no microprocessor, screen or anything resembling modern memory. It received instructions from punched paper tape, while its logic was built from approximately 13,000 electromagnetic relays. Each was a physical switch. An electrical current moved a small metal armature, opening or closing a contact, and thousands of these movements together performed a calculation.
In other words, the machine thought in clicks. With its units operating in parallel, it could perform up to eight additions and four multiplications per second. Today, that sounds almost geological in its slowness. At the time, however, the Mark II could compress hours of human calculation into minutes.
Yet its power remained entirely physical. A program could be held in the hand like a scroll of perforated paper, and an error could be corrected by patching the tape and punching new holes. A malfunction might have a sound or leave a visible trace. Dust or a worn contact could produce an incorrect result. On that September afternoon, however, the malfunction also had wings.
The logbook preserved the precise details: "Relay #70, Panel F," along with the time, 15:45.
After the machine arrived in Dahlgren, the Navy fired its heavy guns to determine whether the resulting vibrations would disrupt the relays. The Mark II was expected to withstand nearby artillery fire, yet it entered history because of a moth.
The word the moth did not invent
The joke works only because everyone already knew what bug meant. Had the word been coined that day, the phrase "actual case" would have made no sense. The Mark I team had already used it to describe coding problems, and Grace Hopper had even drawn cartoons of the various "bugs" they encountered. The moth did not give the computer error its name, but it did provide the perfect illustration for a word already in use.
The trail reaches back roughly seventy years earlier, into the age of the telegraph. As early as 1875, the technical journal The Operator referred to a "bug" in an electrical device. American inventor Thomas Edison frequently used the word in his notebooks and letters. It was his term for the small defects that emerged after the first flash of inspiration, once the real work of turning an idea into a reliable machine had begun.
By 1892, "bug" had already entered the vocabulary of electrical engineering as a fault in the connections or operation of an electrical apparatus. Even the word "debugging" was recorded before the Harvard moth, appearing in aeronautical engineering in 1945.
There is one final layer of linguistic irony. In the strict entomological sense, the English term true bug refers to a particular group of insects, while moths belong to the order Lepidoptera. The most famous "actual bug" in computing history, technically speaking, was not a true bug at all. That day, technology acquired a myth good enough to survive even its own taxonomy.
When "loop," "patch" and "library" were physical objects
The computing vocabulary of the 1940s sounds surprisingly modern, but the terms did not yet refer to abstract commands hidden inside memory. They described objects an operator could pick up, cut with scissors or place on a shelf. A program physically passed through the machine as a strip of paper tape, with instructions and numbers encoded in patterns of punched holes.When a sequence of instructions had to be repeated, the ends of the tape were joined to form a closed "loop." The tape would circle continuously through the reader, causing the computer to execute the same series of operations again and again. In other words, the first programming loops did not run invisibly in memory. They literally turned before the operator’s eyes.
When an error was found in a program, the faulty section of tape could be covered with a piece of paper and punched again. It was a genuine "patch." Nor was a "library" merely a virtual collection of functions. Sections of tape produced for earlier tasks were stored so they could be reused. The required segment would be retrieved, cut out and joined to a new program using adhesive and a hot iron.
Code reuse, program loops and libraries therefore existed before they could be stored in digital memory. The difference was that programming still looked somewhat like work performed in a tailor’s shop. The words survived, while the objects that inspired them disappeared. In such a world, perhaps it is not so strange that a "bug" could have a body of its own!
Grace Hopper and the power of a good story
Much the same is true of Grace Hopper. The American mathematician, then a lieutenant in the US Navy, was a key member of Harvard’s computing team. She earned her doctorate at Yale, taught at Vassar and became one of the first programmers of the Mark I during the war. Yet there is no firm evidence that she personally found the moth or wrote the note. Hopper herself later said that it was removed with tweezers by "the operator."

What Hopper did was preserve the story and retell it to audiences for decades. The Computer History Museum states that she was present, while the Smithsonian notes that the logbook was probably not hers. Over time, the distinction between being a member of the team and being the person who made the incident immortal gradually disappeared.
It is no accident that the anecdote became so closely associated with Hopper. She was an extraordinary interpreter between machines and human beings. In 1952, she developed A-0, one of the earliest systems for automatically translating programming instructions, and later championed languages that resembled ordinary English. Her work on FLOW-MATIC profoundly influenced the development of the COBOL programming language.
The perfect alibi for an imperfect machine
The word bug survived every technological revolution the Mark II could never have imagined. Relays gave way to vacuum tubes, then transistors and microchips. Programs migrated from paper tape to distant data centers. Errors became less visible, but no less real. They might emerge only after millions of correct operations or in the split second when two processes collide.
The metaphor endures because a bug behaves like an unwanted intruder. It hides, leaves traces and appears when no one is watching. At the same time, it provides the perfect linguistic alibi. We say that a bug "crept into" a program, as though the code had previously been pristine and the fault arrived from somewhere outside. In reality, most computer bugs never "arrive" from anywhere. People create them along with the systems themselves, often at precisely those points where they failed to anticipate how different rules would collide.
The original logbook containing the moth is now preserved at the Smithsonian’s National Museum of American History. The tape holding it in place has yellowed and the insect is slowly disintegrating, but the story survives. It is a fossil from an age when a computer error could be removed from the machine, taped to a sheet of paper and pointed at with a finger!
Sources
- Computerhistory.org September 9: First Instance of Actual Computer Bug Being Found | This Day in History | Computer History Museum https://www.computerhistory.org/tdih/september/9/
- Americanhistory.si.edu Log Book With Computer Bug https://americanhistory.si.edu/collections/object/nmah_334663
- Chsi.harvard.edu Harvard IBM Mark I - Language https://chsi.harvard.edu/harvard-ibm-mark-1-language
- Daily.jstor.org The Bug in the Computer Bug Story - JSTOR Daily https://daily.jstor.org/the-bug-in-the-computer-bug-story/
- Spectrum.ieee.org Did You Know? Edison Coined the Term “Bug” https://spectrum.ieee.org/did-you-know-edison-coined-the-term-bug
- Juncture-digital.org Earliest Use of the Term "Bug" https://www.juncture-digital.org/edisonpapers/edison-and-the-bug
- President.yale.edu Biography of Grace Murray Hopper https://president.yale.edu/biography-grace-murray-hopper
Comments