worldsbestfacts
1947 computer logbook page with a moth taped to it

1947

One of the most famous computer bugs was an actual moth.

6 min readLast updated

Photo: Courtesy of the Naval Surface Warfare Center, Dahlgren, VA., 1988. · Public domain

The short answer

A real moth was found in Harvard’s Mark II computer in 1947 and preserved in its logbook. It became a famous computer bug, but it did not originate the engineering term “bug.”

Why it's true

The Harvard Mark II used electromechanical relays, physical switches involved in carrying out computations. A moth caught in one of those components was therefore more than a visitor near a computer. It was a literal insect inside working machinery, providing a particularly memorable example of a technical fault with a physical cause.

Engineers attached the moth to a logbook page and wrote “first actual case of bug being found.” The wording was a joke that relied on an existing technical meaning. Readers were expected to recognize that faults were already called bugs, making the insect an unusually literal instance of the familiar expression.

The Smithsonian's National Museum of American History preserves the logbook. Its description explicitly notes that American engineers had used “bug” for small machine flaws for more than a century, including Thomas Edison's references to electrical problems in the 1870s. The artifact is evidence of the incident, not proof that the word began there.

By the numbers

1947

Year of the recorded Mark II moth incident

1870s

Edison was already using bug for technical faults

Mark II

Harvard computer associated with the preserved moth

The backstory

Large early computers needed systematic records of their operation. A logbook helped staff document symptoms, interventions, and results, providing continuity when different people worked on a machine. Preserving the insect beside the written note made this particular maintenance event unusually tangible, connecting an abstract computing story to a surviving physical object.

Grace Hopper worked on the Mark II project and helped popularize the story. That association often turns into the stronger claim that she personally discovered the moth. The museum's account is more cautious: engineers working on the machine found it, and the logbook was probably not Hopper's own. Participation and personal discovery are different claims.

The same caution applies to calling it the first computer bug. Earlier computers already had faults in hardware and programs, and the vocabulary was older still. What distinguishes the Mark II incident is the combination of an actual insect, a contemporary written joke, a preserved specimen, and an enduring association with a prominent computing pioneer.

The museum's record treats the logbook as a historical collection object, with documentation of its transfer from the United States Navy. Its importance does not depend on being the earliest fault ever experienced by a computer. It gives historians a concrete record of how people maintained machines and talked about their failures.

A literal bug is not a software origin story

In current usage, a software bug is generally a defect in a program, not an insect interfering with a switch. Hardware can also fail, and physical faults can produce misleading computational results. The moth story crosses those categories because ordinary language uses the same word for problems with very different underlying mechanisms.

That makes the incident useful for explaining evidence as well as computing. The logbook supports a narrow, striking statement: a team found and recorded a real moth in a computer. It does not establish that one person invented debugging, that no earlier computer malfunctioned, or that all technical vocabulary can be traced to one entertaining moment.

Worth remembering

  • The preserved moth records a real 1947 incident involving the Harvard Mark II.
  • Engineers used “bug” for faults long before this literal insect appeared.
  • Hopper helped popularize the story, but personal discovery should not be assumed.

In context

The moth story sits between hardware history and the language of engineering. A physical obstruction can produce a fault, but the word bug also covers failures with no insect involved. Keeping the specimen separate from the origin of the term preserves the interesting evidence without repeating an attractive but inaccurate invention story.

A closer look

What a logbook can establish

The preserved page documents a particular incident, rather than proving a universal first. Its attached specimen makes the anecdote unusually tangible. A log entry can establish what operators recorded and how they described it, but a claim about the first use of an engineering word requires earlier written sources as well as the famous page itself.

Hardware faults and software errors

A relay is an electromechanical switching component, so something interfering with its operation belongs to the physical side of computing. A program can also fail because its instructions are wrong, even when every component works as designed. Both may be called bugs in everyday speech. The shared label should not obscure the different investigations needed to find their causes.

Related facts

This companion article explores The first working transistor was built in 1947. The first working transistor was built in 1947.

This companion article explores An integrated circuit puts multiple electronic components on one chip. An integrated circuit puts multiple electronic components on one chip.

This companion article explores An early commercial microprocessor contained just 2,300 transistors. An early commercial microprocessor contained just 2,300 transistors.

This companion article explores Punched cards controlled textile patterns long before electronic computers. Punched cards controlled textile patterns long before electronic computers.

Key terms

Relay
An electrically operated switch with mechanical contacts.
Debugging
Investigating and correcting faults in a system or program; the term does not imply an actual insect.

People also ask

Did the moth invent the word bug?

No. The note played on an established engineering expression that predates electronic computing.

Did Grace Hopper personally find it?

The Smithsonian credits engineers working on the Mark II and does not establish that Hopper herself discovered the insect.

Where is the original evidence?

The logbook containing the moth belongs to the Smithsonian National Museum of American History. Collection ownership does not guarantee that an object is currently on public display.

Does the specimen prove insects caused most early failures?

No. It documents one memorable incident. A preserved example cannot establish how common that kind of failure was across early computers.

Why is the wording in the logbook important?

It presents the insect as a literal instance of an already meaningful engineering expression, rather than evidence that the operators invented the word bug that day.

Sources

Send this to someone

More like this

See all

Join the list.

Every now and then we'll send you a fact you've never heard before.

No spam. No set schedule. Unsubscribe anytime.