The story as usually told
The popular version goes like this. In the early days of computing, a machine stopped working, engineers searched through it, and they found a real insect trapped inside. They removed it, the machine worked again, and from that day onward a fault in a computer was called a bug. The tale is often attached to Grace Hopper, and it is told in classrooms, museum labels and programming textbooks.
Part of this is true, and that is what makes it durable. There is a real moth, a real logbook page and a real note. What the evidence does not support is the claim that this event created the word.
What the logbook actually shows
The artifact in question is a page from a logbook kept by operators of the Harvard Mark II, an electromechanical machine built in the 1940s. A moth was found stuck in one of the machine’s relays, which are switches that open and close with a physical contact. The insect was taped into the log beside an entry dated in September 1947, with a note to the effect that this was the first actual case of a bug being found.
The wording matters. The phrase “first actual case” is a joke that only works if “bug” already meant a fault. Calling it the first actual bug is funny because everyone reading the log already used the word for the usual, non-insect kind of trouble. The writer was playing on existing slang, not introducing new vocabulary.
The page was kept, and it is now held in a national museum collection in the United States. Photographs of it are widely reproduced, which has helped the story travel.
Who was there, and who told the story
Grace Hopper is closely tied to the tale because she often repeated it in talks later in her career, and her prominence made it memorable. But the logbook entry is generally credited to people working on the Mark II team, and accounts differ on exactly who wrote it and who found the moth. It is safest to say that her team was involved in the work and that she helped popularize the anecdote, rather than to say she personally pulled out the insect.
This is a useful reminder about how anecdotes grow. A real note becomes a famous quotation, a team becomes one person, and a joke becomes an origin. None of these steps requires bad faith. Each retelling simply trims the awkward details.
The word was older than the computer
The use of “bug” for a hidden defect in a machine goes back well before the electronic era. Engineers in the nineteenth century used the word for small, hard-to-find faults in electrical and mechanical systems. Thomas Edison is often quoted as using it in the 1870s in letters describing problems in his inventions, and the usage appears in other technical writing from around then. Exact first uses are difficult to establish because slang is mostly spoken and only occasionally written down, so it is wiser to say that the term was already in circulation among engineers by the late 1800s.
The idea behind it is easy to understand. A small, unexpected thing can interfere with a machine, and the cause may be hard to see. Whether the culprit was a loose wire, a dirty contact or an actual insect, the word captured the feeling of a gremlin in the works.
That means the Mark II page proves something narrower than the legend suggests: it records a literal bug, found by people who were already using the figurative one.
Why insects could really cause trouble
The joke was plausible. Relays have moving parts and electrical contacts that must close cleanly, and a small object caught between them could keep a circuit from working. A modern software bug is different: it is a mistake in a program’s instructions, such as a wrong condition. The word survived the shift from hardware to software because the idea, a hidden error causing unexpected behavior, fits both.
What “debugging” adds
Related words followed. “Debugging” came to mean the process of finding and fixing such faults. It was in use in engineering contexts before computers were common, and it became a standard part of programmers’ vocabulary as software grew. Early programmers spent large amounts of time tracing faults, partly because testing was hard and partly because machine time was scarce. If you are curious about how the vocabulary of the field developed, the topic of word origins covers more examples where a familiar term turns out to have an older or less tidy history than expected.
How to read the evidence fairly
It helps to separate three claims that often get merged.
- A moth was found in a computer and taped into a log. Supported by the surviving page.
- The people involved treated it as a funny instance of a known term. Supported by the wording of the note.
- This incident started the term “bug” in computing. Not supported; the term was already established among engineers.
The first two claims make the artifact worth preserving. The third is the part to leave out. Keeping the distinction does not make the story less charming, and arguably it makes it better: a logbook with a joke in it is a nice window into how early machine operators talked to each other.
Why the correction matters
The bug story is often a person’s first encounter with computing history, so it sets expectations: single dramatic moments with a clean cause and effect. The real record is more textured. Vocabulary migrates between trades, jokes become labels, and labels outlive their jokes.
The machine itself belongs to the electromechanical period, and the broader early computing story shows how relay-based machines gave way to electronic designs. The moth is best remembered as an artifact with a sense of humor, not as the birth certificate of a word.