Tales From Today

September 9, 1947 · More from 1947

The Moth That Named the Bug

On September 9, 1947, engineers found a moth in Harvard's Mark II computer, taping it into the logbook as the "first actual case of bug being found."

The Harvard Mark II logbook page with the moth taped in, dated September 9, 1947.

Every programmer knows the word. A "bug" is a flaw in the code, and "debugging" is the hunt to fix it. But on September 9, 1947, the bug was literal — a moth, all wings and legs, pulled from the works of a Navy computer and taped into the logbook for posterity.

The machine was the Harvard Mark II Aiken Relay Calculator, a room-sized electromechanical computer built under Howard Aiken for the U.S. Navy — rows of clicking relays, instead of the vacuum tubes and transistors that would come later, grinding through ballistics calculations. When a computation went wrong on the afternoon of September 9, the crew opened the cabinets and began checking relays, hundreds upon hundreds of them, until Panel F, Relay Number 70, gave up its secret: a moth, trapped between the relay's contact points. They removed it and preserved the evidence the way engineers do — they taped the moth into the logbook and wrote beneath it: "15:45 Relay #70 Panel F (moth) in relay. First actual case of bug being found."

The story is often credited to Grace Hopper, the Navy mathematician and pioneering programmer who loved to tell it — but the moth was almost certainly found by one of the machine's operators or technicians, not by Hopper herself. And the word "bug" was already old: Thomas Edison had used it for technical glitches back in the 1870s. What the Mark II's moth did was make the metaphor literal, and unforgettable. The Mark II was the second of Howard Aiken's great Harvard computers, the electromechanical successor to the pioneering Mark I — and the moth in its relays became the most famous insect in the history of technology.

The logbook page — moth, tape, and all — now rests in the Smithsonian's National Museum of American History, and the Navy's photograph of it has become one of computing's founding relics. Look closely at the photo and you can see the operator's annotations: the date, the time, the relay number — a two-inch insect immortalized in the official record. (One footnote for the careful-eyed: the Navy's caption on the photograph dates it to 1945, but Harvard's records and the logbook itself say September 9, 1947 — the date historians accept.) Every time a programmer says "let me debug this," they're echoing a moth in a relay in 1947.

Photo: U.S. Naval Historical Center, public domain (via Wikimedia Commons).

#computers #history #science #technology

Also on September 9