A Real Moth Inside a Giant: The Story of the World’s First Computer Bug (11 photos)
Every programmer on the planet knows the word "bug." But few realize its origin traces back to Harvard in 1947—to a room humming with a 23-ton computer, where a real-life moth was trapped inside relay #70. September 9 is celebrated as Tester's Day in honor of that exact moment. Here is the full story, from Thomas Edison to Rear Admiral Grace Hopper, and the logbook preserved at the Smithsonian to this day.
3:45 PM, September 9, 1947
The Harvard Computation Laboratory, midsummer heat. A massive room—spanning nearly 4,000 square feet—is filled with rows of metal cabinets. Thousands of relays click and switch as the machine computes. Or rather, is supposed to compute—because something has gone wrong.
The Harvard Mark II at Harvard: rooms like this in the 1940s were known as "computation rooms," where operators were practically hidden behind rows of tall equipment racks.
Operators working on the Harvard Mark II began troubleshooting. The method was simple: check component by component. Finally, someone looked into Relay #70 on Panel F. Tucked inside was a moth—about two inches long, its wings slightly crushed. The insect had gotten stuck between the contacts, breaking the electrical circuit. It was carefully removed with tweezers and taped to a page in the logbook.
The Mark II logbook at the Smithsonian Institution, showing the infamous moth and the handwritten note: "First actual case of bug being found."
Next to the moth, a handwritten note read: "First actual case of bug being found." The time was precisely logged: 15:45. That record survives today. The logbook with the taped moth is preserved at the Smithsonian National Museum of American History in Washington, D.C., and can be viewed online in the museum’s digital archives.
A Monster the Size of Two Tennis Courts
The Harvard Mark II was an electromechanical computer built for the U.S. Navy. Its purpose was to calculate ballistic tables—plotting projectile trajectories. The contract with Harvard was signed in February 1945, construction wrapped up in 1947, and in March 1948, the machine was delivered to the Naval Proving Ground in Dahlgren, Virginia.
The predecessor of the Mark II—the Harvard Mark I, in 1944. The Mark II was noticeably smaller, but it still filled an entire hall.
Weighing 23 tons, the machine spanned over 4,000 square feet—roughly the size of two tennis courts. Instead of vacuum tubes, it relied on roughly 13,000 electromagnetic relays. A relay is a tiny switch: when current passes through its coil, metal contacts close. The moth got trapped right between these contacts, physically preventing them from connecting.
The Harvard laboratory in the 1940s. Finding a fault among thousands of relays meant inspecting each one by hand.
The machine could add two numbers in 0.125 seconds and multiply them in 0.75 seconds. By 1947 standards, that was blazing fast.
The Word "Bug" Predated the Moth by 70 Years
The note in the logbook—"first actual case"—was a joke. The engineers deliberately emphasized the word "actual": by 1947, the term "bug" had long been part of technical slang. The entry was a pun: this time, the "bug" was a literal insect rather than a metaphor.
Thomas Edison was the first to document a technical "bug" in writing. His Menlo Park laboratory, 1880s.
Thomas Edison popularized the word "bug" to describe a technical fault. In a letter dated March 13, 1878, to Western Union president William Orton, Edison wrote about a "bug" in his telephone apparatus—joking that the insect belonged to the "callbellum" genus (from Latin
bellum
for war and
call
; Edison was warring with telephone interference). Even earlier, in 1876, the term appeared in his laboratory notes on electric lighting: "Awful lot of bugs still."
By the 1880s, the word "bug" was used in telegraph offices across the United States—long before computers existed.
By the 1880s, the term had spread beyond Edison’s lab. In 1892, engineer Thomas Sloane included "bug" and "bug trap" in his standard electrical dictionary. So by 1947, the word was routine jargon for any technician.
The pun in the logbook pointed to one thing: this time, the bug was alive. The old metaphor had literally materialized.
Following the moth incident, the word "debugging"—the process of finding and fixing errors—became firmly entrenched in programmers' vocabulary. Today, it is used worldwide without translation.
Grace Hopper: The Woman Who Made the Moth a Legend
Engineers—likely William Burke and his colleagues—found the moth. But it was Grace Hopper who shared the story with the world. She either penned the logbook entry herself or, at the very least, recounted the tale in hundreds of public lectures. The Smithsonian Institution remains cautious about attribution, as it isn't known for certain who held the tweezers. But one thing is clear: legends live on through those who know how to tell them.
Hopper at work in the 1960s. She delivered up to 300 public lectures a year and predicted that computers would one day fit on a desktop.
Grace Brewster Murray Hopper was born on December 9, 1906, in New York City. In 1934, she earned her Ph.D. in mathematics from Yale University. The Navy initially turned her down—at 37, she was considered too old for the WAVES. Hopper persevered and joined the Harvard Mark I program.
Grace Hopper in her U.S. Navy Rear Admiral uniform. She retired in 1986 at the age of 79 as the oldest active-duty officer in the Navy.
After the war, Hopper created the first compiler—a program that translates human-readable code into machine instructions. This laid the foundation for COBOL (Common Business-Oriented Language). Today, 43% of the world's banking systems still run on COBOL, processing $3 trillion in daily transactions.
Hopper retired in 1986 with the rank of Rear Admiral at age 79, making her the oldest active-duty officer in the U.S. Navy at the time. She passed away on January 1, 1992.
Why September 9 Is Celebrated as Tester's Day
The logbook containing the moth is kept at the Smithsonian’s National Museum of American History. The moth remains there to this day, still taped to the page.
September 9 is celebrated as Tester's Day—honoring the specialists who hunt down software errors. Although informal, the holiday has caught on internationally, celebrated by developers, QA engineers, and anyone involved in software testing.
Modern QA testers hunt for bugs in code, but the profession shares the exact same objective: finding whatever keeps the machine from working properly.
Today's software tester must think like both a user and an engineer, spotting what developers overlooked. That core mission—finding the flaw—was set in motion by a humble moth stuck in Relay #70.
Hopper gave up to 300 lectures a year. She retold the moth story over and over, turning a chance incident into tech lore.
Incidentally, the logbook entry from September 9, 1947, wasn't even the first mention of a "bug" within Harvard itself. Physicist Robert Campbell had used the term in his notes on the Mark I as early as 1944. That's why the note "first actual case" was an inside joke—an insider pun that, three-quarters of a century later, became a cornerstone of tech history.
Who deserves greater remembrance—the one who discovers the problem, or the one who tells the story well enough to make it timeless?


















