The first computer bug was a real mothImage: Courtesy of the Naval Surface Warfare Center, Dahlgren, VA, 1988 (Public domain)

3 min read

The fact

On 9 September 1947, engineers testing the Harvard Mark II computer found a moth trapped in one of its relays, taped it into the logbook and wrote: "First actual case of bug being found."

Every programmer fixes bugs. Very few have fixed one with wings. In 1947 a team working on one of the earliest computers in the United States did exactly that, and the evidence still survives, taped to a page of an old logbook.

A moth in Relay 70

The Harvard Mark II, also known as the Aiken Relay Calculator, was a large electromechanical machine that worked with thousands of switching relays. On 9 September 1947, while it was being tested at Harvard University, operators traced a malfunction to Relay No. 70 on Panel F. Trapped between the relay’s contacts was a moth.

According to the US Naval History and Heritage Command, the operators removed the insect and fixed it to the computer’s logbook next to a short entry: “First actual case of bug being found.” They then let colleagues know that they had debugged the machine.

The word was already old

The moth did not invent the word. The Smithsonian’s National Museum of American History notes that American engineers had been calling small flaws in machines bugs for more than a century, and that Thomas Edison talked about bugs in electrical circuits in the 1870s. The joke in the logbook works because the term was already familiar: this time the bug was real.

What the Mark II episode did was give the computing world a memorable story. When the first computers were built in the 1940s, people found faults in both the hardware and the programs, and the words bug and debug soon became standard language for programmers.

Grace Hopper’s part

Mathematician Grace Hopper, who later became a rear admiral in the US Navy and a pioneer of programming languages, was part of the Mark II team. The Smithsonian says the logbook was probably not hers, but that she and her colleagues helped spread the use of the terms. Hopper told the story often, which is a big reason it is still so widely known.

Where the moth is now

In 1988 the logbook, with the moth still taped beside the entry, was at the Naval Surface Warfare Center’s computer museum in Dahlgren, Virginia. It was later transferred to the National Museum of American History in Washington, where it is catalogued as object 1994.0191.01. More than seven decades on, the most famous bug in computing is still exactly where its finders put it.

Key points

  • The moth was found between the contacts of Relay No. 70, Panel F, of the Harvard Mark II on 9 September 1947.
  • The operators taped it into the machine's logbook beside the note "First actual case of bug being found."
  • Engineers had already used the word bug for faults in machines; Thomas Edison used it in the 1870s.
  • Grace Hopper worked on the Mark II team, and the team helped popularise the terms bug and debug in computing.
  • The logbook, with the moth still attached, is held by the Smithsonian's National Museum of American History.

Sources

  1. Log Book With Computer Bug, Smithsonian National Museum of American History
  2. NH 96566-KN The First "Computer Bug", Naval History and Heritage Command
  3. First Computer Bug Discovered, US Department of the Navy CHIPS

Image: Courtesy of the Naval Surface Warfare Center, Dahlgren, VA, 1988, Public domain, via Wikimedia Commons