Grace Hopper Found the First Computer “Bug”- a Real One

A literal moth found in a 1947 computer led Rear Admiral Grace Hopper to coin the term "debugging." This incident, though humorous, highlighted unexpected system failures. Hopper's subsequent work on compilers and higher-level programming language...

Grace Hopper Found the First Computer “Bug”- a Real One
Long before software glitches became commonplace and “debugging” entered the tech lexicon, computer pioneer Rear Admiral Grace Murray Hopper encountered a literal bug inside a machine, and helped name an experience that later generations of programmers would know all too well.

On September 9, 1947, Hopper and her team at the Harvard University Computation Laboratory were working on the Mark II computer, an early electromechanical computer used by the U.S. Navy for scientific calculations. According to the Naval History and Heritage Command, the machine began behaving erratically, producing incorrect results and intermittent errors that defied explanation.

After hours of troubleshooting, technicians opened a relay panel and found the culprit, a moth trapped between contacts. They carefully removed it and taped it into the logbook with the annotation “first actual case of bug being found.” Ever since, Hopper’s anecdote has stood as the origin story of the term "computer bug."


Not the First Bug, But the First Recorded One

The word bug had been used to describe mechanical malfunctions long before computers; even Thomas Edison used the term in the 19th century. But the incident Hopper documented has become the earliest documented case of a literal insect causing a computer error, and it was captured in writing, hardware, and lore in a way that resonated as computers became more widespread. The moth itself was carefully taped into the machine’s logbook, preserved alongside records of the event, and is now an artifact that resides in the Smithsonian National Museum of American History.

Hopper Discovers First Computer Bug
Grace Hopper observes a technician removing a moth from the Harvard Mark II, marking the first documented computer bug.
Hopper’s involvement in the story wasn’t accidental. As a lieutenant (junior grade) in the U.S. Naval Reserve and a computer scientist, she was deeply involved in early programming efforts. According to her official biography with the U.S. Naval Academy Alumni Association, she was among the first programmers of the Harvard Mark I computer and later developed the first compiler, a program that translates human-readable code into machine instructions. Her work laid the foundations for modern programming languages such as COBOL.

From Hardware to Language: Hopper’s Legacy

While the moth in the Mark II was a humorous footnote at the time, it highlighted an important truth about computing: complex systems fail in unexpected ways. Hopper was quick to see that errors would be a constant companion of programming, and she embraced the challenge of reducing friction between human thinking and machine logic.
ADVERTISEMENT

Her work on compilers in the early 1950s emerged from that insight. Rather than writing instructions in cryptic machine code, Hopper pushed for the development of higher-level languages that could be understood and debugged by humans. According to the Computer History Museum, Hopper’s team produced the first compiler, called the A-0 System, and later helped develop FLOW-MATIC, which influenced the design of COBOL, one of the first widely adopted programming languages for business computing.

Hopper was not only a brilliant technologist but also a gifted communicator, someone who understood that computers would only be widely used if humans could interact with them without having to think like them.

The Bug That Became a Metaphor

After the incident with the moth, Hopper began using the term “debugging” to describe the process of identifying and removing errors in code or hardware. In a 1986 interview with Computerworld, she described showing the logbook entry to audiences as a way to illustrate the challenges of early computing. “It was a joke,” she said. “It was literally a bug in the machine.”

The logbook note and Hopper’s genial retelling of it helped embed the phrase bug and debugging into programming culture. Within decades, these terms were ubiquitous in computer science departments, tech companies, and eventually mainstream language, describing everything from software glitches to everyday frustrations.
ADVERTISEMENT

More Than a Footnote

While the moth story is charming, Hopper’s influence goes far beyond a single insect. She was a trailblazer for women in technology at a time when computing was still new and largely male-dominated. According to historian Janet Abbate, author of Recoding Gender: Women’s Changing Participation in Computing, Hopper’s success “challenged traditional narratives about who makes history in tech,” opening doors for future generations of women in science and engineering.

By the time she retired from the U.S. Navy in 1986 at the rank of rear admiral, Hopper had become one of the most beloved figures in computing. President Ronald Reagan awarded her the National Medal of Technology, and institutions around the world later named awards, scholarships, and fellowships in her honor.
ADVERTISEMENT

The Bug Lives On

Today, when programmers talk about hunting bugs in code or celebrate “debugging milestones,” they are participating in a tradition that traces back to a moment in a basement computing lab and a reluctant moth that disrupted a machine. According to historians and computing experts, that story, at once literal and metaphorical, helped shape how generations of people think about computers, errors, and the very nature of programming.

Grace Hopper didn’t simply find a bug. She helped define a way of thinking, one that sees mistakes not as failures but as opportunities for understanding, improving, and innovating. And for that, she remains one of the most human figures in the history of technology.
Download
The Economic Times Business News App
for the Latest News in Business, Sensex, Stock Market Updates & More.
Download
The Economic Times News App
for Quarterly Results, Latest News in ITR, Business, Share Market, Live Sensex News & More.
READ MORE
ADVERTISEMENT

READ MORE:

LOGIN & CLAIM

50 TIMESPOINTS

More from our Partners

Loading next story
Business News › News › International › US News › Grace Hopper Found the First Computer “Bug”- a Real One
Text Size:AAA
Success
This article has been saved

*

+