On Friday, 25 April 2003, Aron Ralston (James Franco) prepares for a day of canyoneering in Utah's Canyonlands National Park as he drives to the trailhead at night. The next morning he rides through the park on his mountain bike, aiming to cut 45 minutes off the guide book's estimate for the time needed to reach his destination. He is on foot, running along a bare rock formation when he sees two hikers, Kristi (Kate Mara) and Megan (Amber Tamblyn), apparently lost. Ralston convinces the pair that he is a trail guide and offers to show them a much more interesting route than the one they had been trying to find. He leads them through Robbers Roost area narrow canyons, including a blind jump into an underground pool, where the three film themselves repeating the plunge using Ralston's video camera. As they part company, Kristi and Megan invite Ralston to a party they're holding the next night, and he promises to attend. However, they doubt he will show up.
Ralston continues into Blue John Canyon, through a narrow passage where boulders are suspended, wedged between the walls of rock. Ralston slips and falls into the canyon. One boulder is jarred loose, falling after Ralston to the bottom of the canyon and smashing his right arm against the canyon wall, trapping him. He initially yells for help, but the extreme isolation of his location means that nobody is within earshot. As he resigns himself to the fact that he is on his own, he begins recording a video diary on his camera and using the larger blade on his pocket multi-tool to attempt to chip away at the boulder. He also begins rationing his water and food.
As he realizes his efforts to chip away at the boulder are futile, he begins to attempt to cut into his arm, but finds his knife too blunt to break his skin. He then stabs his arm, but realizes he will not be able to cut through the bone. He finds himself out of water and is forced to drink his own urine. His video logs become more and more desperate as he feels himself dying. He begins dreaming about relationships and past experiences, including a former lover (Clémence Poésy), family (Lizzy Caplan, Treat Williams, Kate Burton), and the two hikers he met before his accident. After reflecting upon his life, he comes to the realization that everything he has done has led him to this ordeal, and that he was destined to die alone in the canyon.
After five days, Ralston sees a vision of a little boy, which he assumes is his unborn son, a blonde boy of about three years (Peter Joshua Hull), through a premonition. He discovers that by using his knowledge of torque and applying enough force to his forearm, he can break the radius and then the ulna bones. He gathers the will to do so and eventually severs his arm with the smaller, less dull knife on the multi-tool. He fashions a crude tourniquet out of the insulation for his CamelBak tube and uses a carabiner to tighten it. Ralston frees himself on Thursday, 1 May 2003, at 11:34 A.M. Mountain Standard Time. He wraps the stump of his arm and takes a picture of the boulder that trapped him as he leaves it behind. He then makes his way out of the canyon, where he is forced to rappel down a 65-foot rockface and hike several miles before, exhausted and covered in blood, he finally runs into a family on a day hike. The family sends for help and Ralston is picked up by a Utah Highway Patrol helicopter, leaving his cap and one of his shoes behind.
The film ends with shots of Ralston from his life after his ordeal — including several of Ralston's further adventures in climbing and mountaineering, which he continued following the accident — and of the real Aron Ralston with his wife, Jessica, whom he met three years later, and their son, Leo, born in 2010. A title card that appears before the closing credits says that Ralston now always leaves a note whenever he goes anywhere alone.
In an alternate ending, Ralston travels via helicopter to a small hospital where he is treated for his injuries, and speaks with his mother for the first time since leaving to Utah. After leaving, he visits his ex-girlfriend Rana, and they talk about the state of their relationship, and he realizes that his son he saw in the canyon will not be hers. The film ends with the same title cards as the original ending.