A piece of software saved the Apollo 11 landing. On July 20, 1969, seconds before the lunar module was due to touch down, the onboard computer raised an alarm. The rest, two men walking on the Moon, rests partly on a woman who stayed out of the spotlight for decades: Margaret Hamilton. The American computer scientist who led the design of the Apollo flight software died on September 30, 2026, at the age of 90. Here is why her work still matters.
A profession she named before practising it
The word is ordinary today. In the 1960s it did not exist. Back then people spoke of "programming", a task seen as secondary, a bit like typing. Margaret Hamilton chose to call it software engineering, so that the activity would earn the same recognition as mechanical or electrical engineering.
"I fought to bring the software legitimacy so that it, and those building it, would be given its due respect," she explained in 2018. "When I first started using this phrase, it was considered to be quite amusing. It was an ongoing joke for a long time."
The stakes were not merely a matter of wording. She had to convince people that software should be designed, tested and verified like any part of a machine, not improvised at the last minute. Today, aircraft, hospitals and banking systems all depend on that idea.
From weather calculations to the conquest of the Moon
Margaret Hamilton was born in 1936 in Paoli, Indiana. She studied mathematics at the University of Michigan from 1955, then earned a degree in mathematics, with a minor in philosophy, from Earlham College in 1958. She moved to Boston in 1959 and soon found a temporary position at MIT, in the meteorology department.
That is where it all began. She programmed her first computers for Professor Edward Lorenz, on weather prediction software, the first of a long line. The same Lorenz would become famous for his work on chaos, the branch of physics showing that tiny differences at the start can completely change how a system unfolds.
In 1961 she joined MIT's Lincoln Laboratory, programming American air defence, the SAGE system. She wrote software for a computer, the AN/FSQ-7, that helped the Air Force spot aircraft. A question began to occupy her: how do you make sure software does not get things wrong? At a time when few people asked it seriously, that obsession would change her career.
In 1965, she was about to go back to graduate school when her husband spotted a newspaper advertisement: MIT's Instrumentation Lab was looking for people to write software meant to "send a man to the moon". Intrigued, she applied. She was hired as the first programmer on the Apollo project, and the first woman programmer there. A year later, she was already leading the onboard flight software team for the crewed missions.
The small error that changed everything
Margaret Hamilton's legend rests partly on an episode that became famous as "the Lauren error". One day her daughter Lauren, then four years old, was playing with the command module simulator at the lab. She pressed the wrong buttons, started a pre-launch program while the simulator was supposed to be in flight, and crashed the whole thing.
Most engineers would have told themselves that astronauts, for their part, would never make that mistake. That is in fact the answer she got when she proposed a fix. So she simply added a warning to the documentation, without holding out much hope.
Three years later, in 1968, she was proved right. During the Apollo 8 mission, astronaut Jim Lovell inadvertently started that same pre-launch program mid-flight, and the navigation data vanished. Hamilton's team was called in to solve it, and her proposed changes were eventually built into the software.
Out of that episode came an idea that would grow into a discipline: defensive programming, software able to anticipate errors and correct itself, without waiting to be told what to do.
"1202": the code that saved Apollo 11
The big moment came in July 1969, during Apollo 11. The lunar module, nicknamed the Eagle, began its descent toward the lunar surface. Suddenly the onboard computer sounded an alarm. The code on display was chilling: 1202.
What was happening? A faulty switch was sending spurious signals that swamped the computer. It was simply choking on the tasks it had to handle and risked losing the ability to fly the landing. In Houston, controllers did not know whether the mission had to be abandoned.
What they did not know was that Hamilton's software had already anticipated this kind of scenario. The program did not follow a fixed order: it ranked tasks by importance and was willing to sacrifice the least urgent ones to focus on the most critical. That is exactly what it did. It dropped the inessentials and carried on with the descent.
The rest is history. The Eagle landed, and two men stepped onto the lunar surface. Hamilton herself told it with grace and no triumphalism: the software did its job, because it had been designed to.
After Apollo: two companies and a language
Margaret Hamilton stayed at MIT's Instrumentation Lab into the 1970s. As the Apollo program wound down, that lab became an independent body, the Draper Laboratory. In 1976 she founded her first software company, Higher Order Software, built on her method of error prevention. A decade later, she created Hamilton Technologies.
Her company developed a language, the Universal Systems Language, meant to design complex systems in which mistakes are unacceptable. The logic has stayed the same since Apollo: think about failures before they happen, rather than catching up afterwards. Over her career she authored more than 130 publications.
The honours eventually caught up with her. In 2003 NASA gave her its Exceptional Space Act Award. In 2016 President Barack Obama presented her with the Presidential Medal of Freedom, the highest American civilian honour, praising a woman who "defined new forms of software engineering". A Computer History Museum fellowship followed in 2017, a lifetime achievement award in 2019, and induction into the National Aviation Hall of Fame in 2022.
A legacy still written into our lives
Her influence can be measured by what quietly works today.
Reliability as a requirement. The defensive programming she helped define became the standard wherever a failure is costly: avionics, medicine, banks, space probes. Every time a system spots an anomaly and keeps running in a degraded mode, it is applying an idea born in her lab.
Open data. The Apollo flight software was released in full on GitHub in 2015. That release let a whole generation of programmers, amateurs included, read the code that carried humans to the Moon. Software written before most of its readers were born, turned into an object of study and pride.
An icon and a symbol. The 1969 photograph, with her standing beside stacks of printed listings, eventually travelled everywhere. It shows her next to the sheer height of paper her code represented: an image that became a landmark for women in science and computing. In 2017 a Lego figure of her appeared in a "Women of NASA" set, alongside other figures from American space history.
Software changed the world, and she spent her life saying so: software is not housekeeping. It is engineering. Margaret Hamilton leaves a legacy you can check every time a machine, on its own, makes the right call in the middle of a flood of data.
Going further
- The other figures of science told by the site: our researchers index.
- This article's main source: MIT's obituary for Margaret Hamilton, and NASA's page telling the story of the 1969 photograph.
- The world of her youth, in her own words: her oral history interview for the Computer History Museum.
- The key ideas behind the story: the Moon and the Solar System in our glossary.
- The other way to reach the Moon today, through robotic craft: the Chandrayaan-3 page in our catalogue.
- The Moon is out tonight, no flight software required: our interactive sky map and its observing guide.
- How four astronauts watched the Moon with their own eyes in 2026: our article on Artemis II's first science report.





