Back to the archive

The encyclopedia · Software & IT · Technical decision · 1947

The first computer 'bug' was a real moth — and it taught engineers to check the hardware

In 1947, a moth was found trapped in a relay of the Harvard Mark II computer. Grace Hopper taped it into the logbook. The term 'debugging' was born.

Harvard University · US Navy · 1947-09-09

What happened

On September 9, 1947, operators of the Harvard Mark II computer found a moth trapped in a relay, causing the machine to malfunction. Grace Hopper, a pioneer of computer programming, taped the moth into the logbook with the note 'First actual case of bug being found.'

The incident was not the first use of the term 'bug' for a technical malfunction — Thomas Edison had used it decades earlier — but it became the most famous. The logbook entry, preserved at the Smithsonian, is a landmark in computing history and a reminder that the most sophisticated systems can be brought down by the simplest physical problems.

The case is often cited as a 'lucky mistake' — a serendipitous discovery that became part of computing culture. But it also carries a lesson: when a complex system fails, check the physical layer first. The most elegant software in the world cannot compensate for a moth in the relay. The hardware is the foundation, and the foundation is where the bugs hide.

Why it happened

  • A moth trapped in a relay caused the Harvard Mark II to malfunction.
  • The incident became the most famous example of a physical 'bug' in computing history.
  • Grace Hopper's logbook entry coined the popular usage of 'debugging.'
  • The case reminds engineers to check the physical layer when complex systems fail.
What it costa stopped machine and a moth taped into the loglucky mistake

The lesson

When a complex system fails, check the physical layer first. The Mark II was brought down by a moth, not a code error. The foundation is where the bugs hide — literally.

Aftermath

The logbook entry is preserved at the Smithsonian. The term 'debugging' became standard in software engineering. The case is cited as a reminder that hardware and software are inseparable, and that the simplest explanation is often the right one.

Sources

spotted an error? The club wants to know.

Comments · 0

    Sign in to join the comments.

    More like this

    Somewhere, someone solved the problem this company failed at. 2nd Opinion →