The First Bug in a Computer

How a real moth stuck in the Harvard Mark II in 1947 became the most famous bug in computing history — and gave us the term "debugging."

The Moth That Made History

On September 9, 1947, operators working on the Harvard Mark II electromechanical computer at the Naval Weapons Laboratory in Dahlgren, Virginia, traced a malfunction to a moth trapped in one of the machine's relays. They carefully removed the insect and taped it into the computer's logbook alongside the notation: "First actual case of bug being found."

The Mark II was a massive machine that used electromechanical relays to perform calculations. Unlike modern transistor-based computers, its mechanical parts were vulnerable to physical interference. The moth caused a relay to fail, disrupting the machine's operation — quite literally a "bug" in the system.

The Origin of "Bug" in Engineering

While the 1947 moth is the most famous computer bug, the word "bug" was used for technical glitches long before computers existed. Thomas Edison wrote in an 1878 letter about bugs in his inventions, describing unexpected problems that required investigation. Engineers of the early 20th century commonly referred to technical defects as "bugs."

What made the Harvard Mark II incident special was the literal truth of it — an actual bug caused a computer bug. The logbook entry captured this irony perfectly, and the story spread through the computing community, cementing the terminology in popular culture.

Grace Hopper and the Debugging Legacy

Rear Admiral Grace Hopper, a pioneer of computer programming and one of the developers of COBOL, is frequently associated with this story. While she was part of the team working with the Mark II, the moth was found by other operators. Hopper's role was in popularizing the anecdote and the terms "bug" and "debugging" throughout her long and influential career.

Hopper's contributions to computing go far beyond the bug story. She developed the first compiler and championed the idea that programming languages should be closer to English, leading to COBOL and modern high-level languages.

Bug Detection Today

From a literal moth in a relay to complex software defects in modern applications, the concept of "debugging" has evolved enormously. Today, automated bug detection tools use AI to find defects that would take humans hours to uncover, scanning applications across browsers and devices in minutes.

The spirit remains the same: find the problem, document it, fix it, and prevent it from happening again. Tools like Bugster continue this tradition by automatically testing real user flows on every code change.

Frequently Asked Questions

What was the first computer bug?

The first documented computer bug was a real moth found trapped in a relay of the Harvard Mark II computer on September 9, 1947. The operators taped it into the logbook with the note 'First actual case of bug being found.' The logbook page is now preserved at the Smithsonian National Museum of American History.

Did Grace Hopper discover the first computer bug?

Grace Hopper is often credited with the discovery, but the moth was actually found by her colleagues, operators of the Mark II at Harvard. However, Hopper helped popularize the terms 'bug' and 'debugging' in computing through her influential career in computer science.

Was the term 'bug' used before the moth incident?

Yes. Thomas Edison used the word 'bug' to describe technical problems as early as 1878. Engineers and inventors had used the term informally for decades before the 1947 moth incident, which gave the term a literal and memorable illustration.

Where is the original computer bug today?

The logbook page with the taped moth is preserved at the Smithsonian's National Museum of American History in Washington, D.C. It remains one of the most iconic artifacts in computing history.

Bugster Logo

The First Bug in a Computer

How a real moth stuck in the Harvard Mark II in 1947 became the most famous bug in computing history — and gave us the term "debugging."

The Moth That Made History

On September 9, 1947, operators working on the Harvard Mark II electromechanical computer at the Naval Weapons Laboratory in Dahlgren, Virginia, traced a malfunction to a moth trapped in one of the machine's relays. They carefully removed the insect and taped it into the computer's logbook alongside the notation: "First actual case of bug being found."

The Mark II was a massive machine that used electromechanical relays to perform calculations. Unlike modern transistor-based computers, its mechanical parts were vulnerable to physical interference. The moth caused a relay to fail, disrupting the machine's operation — quite literally a "bug" in the system.

The Origin of "Bug" in Engineering

While the 1947 moth is the most famous computer bug, the word "bug" was used for technical glitches long before computers existed. Thomas Edison wrote in an 1878 letter about bugs in his inventions, describing unexpected problems that required investigation. Engineers of the early 20th century commonly referred to technical defects as "bugs."

What made the Harvard Mark II incident special was the literal truth of it — an actual bug caused a computer bug. The logbook entry captured this irony perfectly, and the story spread through the computing community, cementing the terminology in popular culture.

Grace Hopper and the Debugging Legacy

Rear Admiral Grace Hopper, a pioneer of computer programming and one of the developers of COBOL, is frequently associated with this story. While she was part of the team working with the Mark II, the moth was found by other operators. Hopper's role was in popularizing the anecdote and the terms "bug" and "debugging" throughout her long and influential career.

Hopper's contributions to computing go far beyond the bug story. She developed the first compiler and championed the idea that programming languages should be closer to English, leading to COBOL and modern high-level languages.

Bug Detection Today

From a literal moth in a relay to complex software defects in modern applications, the concept of "debugging" has evolved enormously. Today, automated bug detection tools use AI to find defects that would take humans hours to uncover, scanning applications across browsers and devices in minutes.

The spirit remains the same: find the problem, document it, fix it, and prevent it from happening again. Tools like Bugster continue this tradition by automatically testing real user flows on every code change.

Frequently Asked Questions

What was the first computer bug?

The first documented computer bug was a real moth found trapped in a relay of the Harvard Mark II computer on September 9, 1947. The operators taped it into the logbook with the note 'First actual case of bug being found.' The logbook page is now preserved at the Smithsonian National Museum of American History.

Did Grace Hopper discover the first computer bug?

Grace Hopper is often credited with the discovery, but the moth was actually found by her colleagues, operators of the Mark II at Harvard. However, Hopper helped popularize the terms 'bug' and 'debugging' in computing through her influential career in computer science.

Was the term 'bug' used before the moth incident?

Yes. Thomas Edison used the word 'bug' to describe technical problems as early as 1878. Engineers and inventors had used the term informally for decades before the 1947 moth incident, which gave the term a literal and memorable illustration.

Where is the original computer bug today?

The logbook page with the taped moth is preserved at the Smithsonian's National Museum of American History in Washington, D.C. It remains one of the most iconic artifacts in computing history.