Technology The Story
The Moth in the Machine
In 1947, engineers working on an early computer at Harvard found a moth trapped in one of its relays. They taped it into their logbook with a joke: "First actual case of bug being found." The moth is still there.
At 3:45 in the afternoon on 9 September 1947, the operators of one of the world's earliest computers were trying to work out why it was giving errors.
The machine was the Harvard Mark II, a huge calculator built for the US Navy at Harvard University. It filled a room, used thousands of electromechanical relays — small switches that clicked open and shut — and could perform calculations far faster than any human.
The operators searched through its parts. In Panel F, inside Relay number 70, they found the problem. A moth had flown into the machine and got trapped between the relay's contacts, stopping it from working.
They removed the moth and taped it into the logbook. Beside it, someone wrote: "First actual case of bug being found."
Not the first "bug"
The joke in the note is the word "actual". The engineers were not inventing the word bug for a technical fault. They were laughing because, for once, the bug was a real insect.
Engineers had been calling faults "bugs" for decades. In 1878, the inventor Thomas Edison wrote in a letter about how difficulties in inventions appear: "'Bugs' — as such little faults and difficulties are called — show themselves," he wrote, and months of work are needed before success. The term was common in telegraph and telephone engineering, perhaps from the idea of an imaginary insect hiding in the machine and causing trouble.
The engineers didn't invent the word bug. They were laughing because, for once, it was a real insect.
Grace Hopper
The moth story is often connected with Grace Hopper, one of the most important pioneers of computing. Hopper was a mathematician who joined the US Navy Reserve during the Second World War and was assigned to work on the Harvard Mark I, the Mark II's predecessor. She was one of the first programmers of these early machines.
Hopper did not personally find the moth, according to most accounts, but she loved the story and told it often in her talks, which helped make it famous. Over time, many people came to believe she had found it herself, or even that she invented the word "bug". Neither is quite true.
What Hopper did do was change computing in deeper ways. She developed one of the first compilers — programs that translate human-readable instructions into the machine's language — and helped create COBOL, a programming language designed to be closer to English. COBOL went on to be used by businesses and governments for decades, and some of it still runs today.
FACT Established by documentary or physical evidence.
Amazing Grace
Hopper rose to the rank of rear admiral in the US Navy and retired at 79, at the time the oldest serving officer. She was known for handing out pieces of wire about 30 centimetres long, the distance light travels in a nanosecond, to explain why satellite communications took time.
Debugging
The word "debugging", meaning finding and fixing errors, was already in use in some engineering contexts, but the moth story became its most famous illustration. Today, debugging is a huge part of programming. Programmers spend a large share of their time not writing new code but working out why existing code doesn't do what they expected.
Modern bugs are almost never insects. They are mistakes in logic, typing errors, unexpected combinations of inputs, or problems that only appear under unusual conditions. Some have had enormous consequences, crashing rockets, disrupting phone networks and causing financial losses.
The moth today
The Mark II logbook, with the moth still taped to its page, eventually came into the collection of the Smithsonian's National Museum of American History in Washington, D.C. It is one of the most famous objects in the history of computing — a scrap of paper, a few lines of handwriting and the flattened body of an insect that wandered into the wrong place at the right time.
The note's dry humour is part of its charm. It reminds us that the people building the first computers were not just serious scientists but also colleagues who joked about their frustrations.
You learned this today!!! YOU LEARNED THIS TODAY !!!
- On 9 September 1947, operators of the Harvard Mark II computer found a moth trapped in a relay, which was causing an error.
- They taped the moth into the computer's logbook with the note "First actual case of bug being found."
- The word "bug" was already used for technical faults long before 1947, including by Thomas Edison in the 1870s.
- The story is often linked to the computer pioneer Grace Hopper, who worked on the Mark II and helped popularise it.
- The logbook page, with the moth still attached, is held by the Smithsonian's National Museum of American History.
One more thing
Greenland sharks can live for at least 270 years, and possibly much longer.
→ Read something elseSources & further reading
- Software bug, Wikipedia
- Log Book With Computer Bug, Smithsonian National Museum of American History
- Beyer, Kurt. Grace Hopper and the Invention of the Information Age, MIT Press, 2009
StoneRed separates fact, hypothesis and speculation. Spotted an error? We'd genuinely like to know.