Why Is a Software Error Called a “Bug”?

Yes, there was a real moth in a computer in 1947 — but engineers were already calling faults “bugs” long before.

Short answer

Engineers called faults “bugs” in the 19th century — Thomas Edison used the word in the 1870s. The famous story came later: in 1947, operators of the Harvard Mark II computer found a moth stuck in a relay, taped it into the logbook and wrote “first actual case of bug being found”. The joke worked precisely because “bug” already meant a fault.

In this article 9 sections
  1. Before computers
  2. Thomas Edison’s “bugs”
  3. How the word spread
  4. The moth in the machine
  5. Grace Hopper’s role
  6. Where “debugging” comes from
  7. Common myths
  8. Other computer words with a story
  9. Related guides
The Harvard Mark II logbook page from 9 September 1947 with a moth taped to it
The logbook page with the moth found in the Harvard Mark II relay, labelled “First actual case of bug being found”. Image: Naval Surface Warfare Center, Dahlgren / Wikimedia Commons, public domain

Before computers

Long before electronic computers, engineers used “bug” for small, annoying defects in machines. The insect sense of the word is much older — it appears in an English medical text from 1594 — but the technical sense grew up in the second half of the 19th century.2 One of the earliest examples comes from a telegraphy journal in August 1875, which reported that the biggest “bug” yet had been found in a hotel’s electric call system.2

Thomas Edison’s “bugs”

Thomas Edison is the best-known early user of the word. While working on the quadruplex telegraph in the 1870s, his team needed a “bug trap” to deal with false signals, and the term appears in his notebooks from 1876.3

In March 1878 he wrote to William Orton, president of Western Union, admitting that he had found a “bug” in a new telephone design.4 In November that year he wrote to a business associate, Theodore Puskas, explaining that “bugs” was what such little faults and difficulties were called.2,3

Edison did not invent the word — he was using slang that already existed — but he helped spread it.2 By the 1890s it was in print for everyone: an electrical dictionary of 1892 traced it to quadruplex telegraphy, and a general dictionary defined it for the public in 1895.3

How the word spread

Edison’s habit was noticed. In 1888 the telegraph writer William Maver said the term had first been used by Edison, and in 1889 a British newspaper reporter remarked on Edison calling a phonograph problem “a bug”.3 By the 1930s it was ordinary English far beyond engineering: in 1937 New York’s mayor, Fiorello La Guardia, was quoted in The New York Times talking about “bugs, defects or jokers” in a building code.2

The word itself is much older than any machine. IEEE Spectrum links it to older words such as the Welsh “bwg” and the Middle English “bugge”, and Computerworld traces it back to an old word for a monster.3,5

The moth in the machine

The famous story came decades later. Engineers running the Harvard Mark II — a large electromechanical computer built by Harvard with IBM — traced a fault to a moth stuck in a relay. They removed it, taped it into the logbook and labelled it *“First actual case of bug being found.”*1

The log entry, timed at 15:45, records the moth in relay number 70 on panel F.2 The Smithsonian’s National Museum of American History, which now holds the page, dates it to 1947.1 You will sometimes see 1945 instead, but the Mark II only came into use in the summer of 1947, so the later date fits.5

The joke only works because “bug” already meant a fault. The engineers were not coining a word; they were delighted to find a literal one.2,5

Grace Hopper’s role

The computer scientist Grace Hopper worked on the Harvard Mark I, II and III, which is why the moth is so often linked to her.6 She told the story often, but she did not find the moth or write the log entry, and the Smithsonian says the logbook was probably not hers.1,5 What she and the Mark II team did was help make “bug” and “debug” everyday computing words.1

Hopper deserves to be remembered for something much bigger. She published the first paper on compilers — programs that translate human-readable instructions into machine code — and was instrumental in developing the COBOL programming language. She retired from the US Navy in 1986 as a rear admiral, aged 79 — at the time the oldest serving officer in the Navy — and died in 1992. A US Navy destroyer, USS Hopper, carries her name.6

Where “debugging” comes from

Once programs were full of “bugs”, fixing them became “debugging”, and it is still the everyday word for finding and removing faults in software.1,5

Common myths

  • “Grace Hopper invented the word bug.” She didn’t, and the word was in use for at least 70 years before the moth.2,3
  • “Edison coined it.” He used it early and often, but earlier uses exist, such as the 1875 telegraphy report.2
  • “The moth was the first computer bug.” It was the first actual bug — an insect — which is exactly why the team found it funny.1,5

Other computer words with a story

Fun fact

The moth still has its own museum record: the logbook page is catalogued at the Smithsonian as object 1994.0191.01.1

Sources and further reading

  1. Log Book With Computer Bug — Smithsonian National Museum of American History
  2. bug (computer) — Wordorigins.org2020-06-16
  3. Did You Know? Edison Coined the Term “Bug” — IEEE Spectrum2013-08-01
  4. Who coined the term bug? Thomas Edison — Atlas Obscura
  5. Moth in the machine: Debugging the origins of 'bug' — Computerworld2011-09-03
  6. Grace Murray Hopper — US Naval History and Heritage Command2019-10-02

Was this article helpful?

Comments

No comments yet. Questions and tips from readers are welcome.