On sol (day) 18 of their 31-sol trip to Mars in 2035, the crew of the Ares III mission is investigating Acidalia planitia. A severe dust storm is anticipated to topple their Mars Ascent Vehicle (MAV). The mission is canceled while the crew is fleeing, but astronaut Mark Watney is struck by flying debris. Watney is falsely believed to be dead since the telemetry on his bio-monitor is malfunctioning. The remaining crew departs for their circling ship, the Hermes, as the MAV is about to topple.
In a public interview, Mr. Teddy Sanders, the administrator of NASA, lamented that astronaut Mark Watney tragically died when he got struck by debris while being evacuated. After the storm, Watney awakens with injuries and a low oxygen alert. He fixes his wound when he returns to the crew's surface habitat (the "Hab"). Watney starts a video journal as he gets better. His only chance of being rescued since he can't communicate with Earth is the upcoming Ares IV Mars mission, which will land 3,200 kilometers (2,000 km) distant near the Schiaparelli crater in four years. Food is Watney's top priority. Being a botanist, he uses Martian soil fertilized with the crew's bio-waste to establish a garden inside the Hab, and to produce water, he collects discarded rocket fuel and separates nitrogen and hydrogen.
Watney plans to light the hydrogen in a small space. Something goes wrong, and he forgets to count the excess oxygen in the area and blows himself. Again, he righteous the wrong he did, which was a success. Then, using entire potatoes set aside for a special Thanksgiving meal, he starts to cultivate potatoes. He also starts modifying the rover to prepare for the trip to the Ares IV MAV location.
When studying satellite photographs from Earth, NASA satellite planner Mindy Park observes relocated equipment and deduces that Watney must still be alive. Teddy Sanders chose not to inform the Ares III crew so they could remain focused on their goal of returning home. Mr. Teddy plans to bring Watney back without telling their crew. On the other hand, Watney manages to recharge the rover's battery and control the rover's interior temperature at night.
Mr. Teddy ordered the director of the JET propulsion laboratory, Mr. Bruce, to get the pre-supply within three months, which takes nine months to get done. Despite flight director Mitch Henderson's objections, Teddy still chose not to inform the crew. Watney in Mars reaps and re-sows the potatoes. Watney looks for a Pathfinder that went silent in 1997 to get in touch with NASA.
Mr. Vincent, director of the Mars Mission, discovers that Watney is looking for a pathfinder after following Watney's motion. To recover the Pathfinder probe and the Sojourner rover, Watney sent the rover on a one-month expedition. He establishes visual communication with NASA by using Pathfinder's camera and motor. To connect the mission's rover with Pathfinder and enable text communication, NASA sends a software patch. Henderson is ultimately permitted by Sanders to inform Watney's crew, and Henderson informs the crew.
According to the botany team's estimate, Watney's crop will last about 912 sol, while NASA aims to be there in 868 sol. Head of Mars missions Vincent Kapoor and the head of the Jet Propulsion Laboratory (JPL), Bruce, plan a spacecraft to carry Watney with enough supplies to last until Ares IV arrives. All the potato plants perish as the airlock of the Hab blows away, exposing the Hab to the hostile Martian atmosphere. To save time, Sanders directs that the customary safety inspections be skipped. On Mars, Watney manages to fix the Hab with whatever he has. As a result, shortly after takeoff, the Atlas V rocket explodes.
The Taiyang Shen booster rocket was developed by the China National Space Administration. To get a Chinese astronaut on the upcoming Ares mission, it is decided to use the rocket to replenish Watney. Rich Purnell, from astrodynamics, comes up with a different idea: have the Taiyang Shen meet the Hermes and replenish it. The Hermes will then utilize the gravity of Earth to "slingshot" back to Mars two years before Ares IV. Sanders dismisses the notion, believing it to be too dangerous for the Hermes crew. Purnell's idea is covertly sent to the crew by Henderson, who unanimously decides to implement it without asking NASA's consent, deactivating NASA's remote controls and changing the route.
Also, the crew decides to get Watney back and gets ready to spend another 533 days on the mission. Sanders is compelled to publicly back them, but once the Ares III mission is over, he demands Henderson step down. Every Ares mission requires three years of pre-supplies. Therefore, NASA long ago determined that it is far simpler to send some of the cargo in advance rather than along with the crew. So, as a result, the MAV 4 Ares is already there at Schiaparelli Carter, just waiting. Watney's strategy is to enter orbit as Hermes approaches and be caught in space by the crew.
Meanwhile, NASA sent the Taiyang Shen booster rocket connects the Hermes successfully.
Watney starts the 90-sol trip to Schiaparelli, where the Ares IV MAV has already been set up. Mars’s gravity entirely, and to intercept homes, MAV needs to be significantly 5000kg lighter to reach the speed. He has to move around the area, and an MAV's head has to be covered by the tarp to make it happen. Finally, Watney ends his 561 sols alone on Mars.
When the MAV loses fuel after launch, its relative velocity to the Hermes is too high for Watney to be picked up. Commander Lewis quickly improvises and uses an explosive to burst a front airlock, forcing air to escape and causing the Hermes to be detained. With a tethered Manned Manoeuvring Unit, Lewis remains unable to approach Watney. Watney punctures his pressure suit before reaching Lewis. After returning to Earth, Watney trains aspiring astronauts in survival skills. Five years later, the individuals engaged when the Ares V is about to lift off, we see the survivors of Watney's rescue in their modern lives.