
This Day in History — The First Literal Computer Bug Is Recorded
On this day in 1947
On September 9, 1947, William Burke found a moth in Relay 70 of the Harvard Mark II, taped it into the logbook, and wrote: First actual case of bug being found.
The Off-Key Bard watches engineers troubleshoot a massive electromechanical computer. Somewhere among thousands of switches and relays, something isn't working properly. The culprit turns out to have wings.
"Computer bugs existed before this one. This was the one that was actually a bug."
On September 9, 1947, at 3:45 in the afternoon, a team of engineers at Harvard University's Computation Laboratory was running tests on the Harvard Mark II Aiken Relay Calculator when the machine developed a fault. The Mark II was an enormous electromechanical computer built for the U.S. Navy under the direction of mathematician Howard Aiken — roughly 25 tons of steel, wire, and electromechanical relays, containing approximately 13,000 individual relay switches. Each relay was a small mechanical switch: two metal contacts that closed when an electromagnet pulled them together. The machine's arithmetic depended entirely on whether thousands of those contacts were opening and closing correctly.
One of them wasn't.
Engineer William B. Burke opened Panel F and looked into Relay #70. He found a moth — roughly two inches across, quite dead — wedged between the relay contacts, stopping the current cold. He extracted it with tweezers. Then someone taped the moth to the page of the operations logbook and wrote beside it:
"Relay #70 Panel F (moth) in relay. First actual case of bug being found."
That logbook page, with the moth still taped to it, is now in the collection of the Smithsonian's National Museum of American History. It has been there for 79 years. The moth is still there too.
Why "First Actual Case"
The wording matters. Engineers had been calling technical faults "bugs" for decades before September 9, 1947. Thomas Edison used the term in correspondence as early as 1878, when he wrote about discovering "a bug" in his phonograph. Mechanical engineers and telegraph operators used it throughout the late 19th and early 20th centuries. The Harvard Mark II team knew exactly what a technical "bug" was — which is precisely why the joke worked. They had found a case where the metaphor had literally come to life.
The label says "first actual case" as a wink: not the first use of the word "bug," but the first time the bug was an actual bug.
Grace Hopper's Role
Grace Hopper is frequently credited with discovering the moth, and the incident is often told as her story. The historical record is more careful. Hopper was a pioneering computer scientist who worked with Aiken's team and helped build and program the Mark II — her contributions to computing were immense and real. The Smithsonian Institution, which holds the logbook, notes that it was "probably not Hopper's." The Computer History Museum records that Hopper was present and "made the incident famous" through her many subsequent public lectures, which she gave throughout her long career.
The distinction matters because Hopper's actual achievements — she later developed the first compiler, championed the idea that programming languages could use English-like syntax, and helped create COBOL — are significant enough without also needing to claim credit for a discovery that historical evidence attributes to Burke and his colleagues.
What Hopper did do, through decades of storytelling, was ensure that one of computing's most enduring metaphors stayed attached to this specific moment. She turned a logbook entry into folklore.
The Machine, The Moth, and the Language
The word "debug" and its derivatives spread rapidly through the computing community in the years after 1947, helped along by Hopper's lectures and the general growth of the field. By the time computers transitioned from electromechanical relays to vacuum tubes to transistors to integrated circuits, the metaphors had fully transferred from hardware to software. Today's programmers can spend hours debugging millions of lines of code without encountering a single actual insect.
The Mark II itself was delivered to the Naval Proving Ground at Dahlgren, Virginia in March 1948, where it performed ballistic calculations for the U.S. Navy until it was decommissioned.
The moth in the logbook connects two very different eras of computing. Modern processors contain billions of transistors on chips smaller than a thumbnail. The Mark II was large enough that a moth could crawl inside, lodge between the contacts of a relay, and bring the whole calculation to a halt.
"The relays clicked, then something stopped,
A tiny moth inside had dropped.
They found the fault and logged it right —
The strangest bug in code's long flight."
History sometimes becomes memorable through enormous theoretical breakthroughs. Other times it's preserved through a wonderfully literal coincidence — a moth, a pair of tweezers, a strip of tape, and someone who decided that the joke was too good not to write down.
Sources
- The Bug in the Computer Bug Story — JSTOR Daily — JSTOR Daily
- First Computer Bug Is Found — Computer History Museum — Computer History Museum
- The First Use of "Bug" in the Context of Computing — History of Information — History of Information
- Harvard Mark II — Wikipedia — Wikipedia