The First Bug: A Moth in Relay 70
Abstract
On September 9, 1947, engineers testing the Harvard Mark II at Harvard’s Computation Laboratory in Cambridge, Massachusetts, found a moth jammed in relay 70, Panel F, causing a malfunction. (The machine was not delivered to the Navy’s Dahlgren proving ground until the following spring.) The insect was taped into the logbook with the annotation: “First actual case of bug being found.” The word “bug” for a technical defect had been in engineering use for decades, the moth was not the origin, but a literal, accidental illustration of a metaphor already embedded in the vocabulary of anyone who worked with machines.
The Mark II and the Moth
The Harvard Mark II was an electromechanical calculator, not electronic, but mechanical. Its computational elements were relays: electromagnetic switches that close or open a physical metal contact when current flows through a coil. Each relay was roughly the size of a matchbox. The Mark II contained thousands of them, clicking and switching hundreds of times per second during a calculation run.
On the afternoon of September 9, 1947, an error appeared during a test. Troubleshooting located the cause: a moth had flown into the relay bay and become wedged between the contacts of relay 70, preventing it from closing. The moth was removed with tweezers. The operators, colleagues of Grace Hopper on the Mark II project, taped it into the maintenance logbook with the entry:
1545. Relay #70 Panel F (moth) in relay. First actual case of bug being found.
The logbook page, moth intact, is preserved at the Smithsonian’s National Museum of American History.
The Word “Bug” Predated the Moth by Decades
The phrase “bug in the system” was engineering slang long before 1947. Thomas Edison used it in an 1878 letter describing the iterative process of developing a new invention:
It has been just so in all of my inventions. The first step is an intuition… then difficulties arise (this thing gives out and then that) ‘Bugs’ as such little faults and difficulties are called, show themselves.
Telephone engineers in the early 20th century used “bug” for intermittent faults, behavior that appeared and disappeared without obvious cause, like an insect that could crawl in and out of a mechanism. By 1947, the term was embedded in the vocabulary of anyone working with electrical machines.
Whoever wrote “First actual case of bug being found” was making a joke, a deliberate play on existing slang, funny precisely because they had found a literal insect. Nobody was claiming to have coined the word. They were performing a pun. Hopper, who was not the one who found the moth, told the story for the rest of her life and is the reason anyone remembers it.
Grace Hopper and the Mark II
Grace Hopper was a naval officer and mathematician who joined the Harvard computation project in 1944, initially programming the Mark I. She became one of the most capable programmers of the early computing era, later designing FLOW-MATIC, the first English-language data processing compiler, and serving as technical consultant to the 1959 CODASYL effort whose committee, staffed partly by her former employees, extended FLOW-MATIC into COBOL. The Mark II project was one step in a career that spanned the entire first generation of computing.
The Mark II itself was already slightly behind the technological frontier when the moth was found: the ENIAC, a fully electronic machine with no moving parts in its computational elements, had been operational since 1945. Vacuum tubes failed frequently, but they could not be jammed by insects. The moth incident illustrates the specific vulnerability of electromechanical computing that electronic computing solved, though it introduced its own reliability problems in the process.
Why the Story Endures
The taped moth became one of the most frequently reproduced artifacts in computing history. Hopper told the story throughout her career, and it became a fixture of introductory programming courses. The reason is narrative efficiency: a physical insect causing a literal malfunction in a machine is more vivid than the correct etymology, a metaphor borrowed from 19th-century engineering vernacular. The story is also humanizing. The early computing pioneers were solving problems of extraordinary difficulty with unreliable hardware, and they were funny about it. Writing “First actual case of bug being found” in an official maintenance log required a particular kind of professional wit.
📚 Sources
- Smithsonian National Museum of American History: First Computer Bug — logbook page, accession 1988.0191.07
- Edison, Thomas A.: Letter to Tivadar Puskas, 13 November 1878, document D7821ZAO — Edison Papers Digital Edition, Rutgers University
- “Did You Know? Edison Coined the Term ‘Bug’” — IEEE Spectrum
- Cohen, I. Bernard: “The Use of ‘Bug’ in Computing” — IEEE Annals of the History of Computing 16(2): 54–55 (1994)
- Shapiro, Fred R.: “Etymology of the Computer Bug: History and Folklore” — American Speech 62(4): 376–378 (1987)
- Hopper, Grace M.: “The Education of a Computer” — Proceedings of the ACM National Meeting, 1952