technology

The First Computer Bug Was a Real Insect

In September 1947 engineers working on the Harvard Mark II recorded finding a moth trapped in a relay and taped it into the machine logbook with the note “first actual case of bug being found.” The anecdote helped popularize the term bug for technical faults, though the word predates the incident

Main claim

The well‑known story holds that the first recorded "computer bug" was literally an insect: on 9 September 1947, operators of the electromechanical Harvard Mark II discovered a moth jammed between relay contacts, removed it, and logged the incident in the machine's logbook as the "first actual case of bug being found".

Discovery and the logbook

Operational teams working on early computers kept meticulous logs of faults and repairs. In the Mark II case, the dead moth was taped to the logbook page to document the tangible cause of a malfunction. That log, with the insect attached, survives in museum collections and has been widely reproduced in histories of computing as a physical relic of the event.

Terminology before 1947

Although the 1947 moth anecdote is memorable and visually compelling, the use of the word "bug" to denote mechanical or technical faults predates the Harvard incident by many decades. Engineers and inventors used the term informally during the 19th and early 20th centuries. For example, Thomas Edison used "bugs" in correspondence to mean glitches or problems in devices. The Mark II moth episode therefore contributed to popular culture and computing lore rather than inventing the term itself.

Grace Hopper and the story’s popularisation

Grace Murray Hopper, a pioneering programmer who worked with the Mark II team, is often associated with the anecdote because she recounted it in public lectures and talks, helping to cement the image of a literal insect causing a machine fault in the public imagination. Historical accounts note that while Hopper helped popularise the tale, the original logbook entry was probably made by another team member. Nevertheless, Hopper’s retellings played an important role in linking the physical moth to the wider vocabulary of programming—especially the terms "bug" and "debug"—in mainstream awareness.

Why the anecdote matters

The Mark II moth story endures because it neatly illustrates several themes about early computing: machines were mechanical and fragile. Faults could have mundane causes, and the human habit of documenting and joking about errors produced archival traces that later generations find irresistible. The taped moth became an emblem of how literal mishaps and metaphorical language can entwine, turning a routine maintenance note into a founding anecdote for an entire vocabulary of software engineering and troubleshooting.

Legacy and interpretation

The lasting legacy of the Mark II incident is cultural as much as technical. The logbook specimen now held in museum collections serves as a didactic artefact used to teach the history of computing and to remind technologists of the humble origins of familiar terminology. At the same time historians emphasise nuance: "bug" as a synonym for error had prior usage, and the development of programming as a discipline produced ever more abstract kinds of bugs—logic errors, race conditions, memory faults—that have nothing to do with literal insects. The moth anecdote therefore functions as both a literal first instance and a story that symbolises a broader conceptual shift in how humans conceive of machine failures.

Conclusion

In summary, the 1947 moth in the Harvard Mark II is a documented, tangible event that helped popularise an already existing term and created an enduring image for generations of programmers. While the word "bug" was not coined by that single incident, the taped insect in the Mark II logbook remains a memorable artefact linking early mechanical computing to modern software culture and language.