Thomas wakes up in a metal elevator that brings him to a place called the Glade. He has no memory of who he is or how he got there. He gradually discovers that the Glade is run by two boys: Alby, the leader, and Newt, the second-in-charge, who both maintain order by enforcing simple but effective rules. The elevator box surfaces from under the ground every week supplying new food, tools, medicine, and sometimes weapons. Every month a new boy with no memory of anything but his first name finds himself in that elevator box. The Glade is surrounded by a square of 4 mile-high walls made of concrete. Outside the walls is the Maze, a labyrinth of high concrete walls covered in ivy that changes every day. The Maze houses strange, lethal creatures known as Grievers. Grievers are described as amorphous monsters of metal and flesh. The Gladers are trying to stay alive as well as "solve" the Maze by running through it as fast as they can while tracking movements of the walls and trying to find an exit to escape.
One day after Thomas' arrival, a girl named Teresa is delivered through the elevator into the Glade with a note saying "She's the last one. Ever." It implies that there will be no more children sent into the Glade. The girl subsequently lapses into a coma. When Thomas comes to visit her, he recognizes her, but can't remember her name until he hears her voice telepathically in his mind telling him her name. Teresa wakes up and tells Thomas that they knew each other before they were sent into the Glade, and reveals that they could communicate telepathically.
Her arrival triggers a series of changes to life in the Glade: People start acting strangely, the sun disappears, the weekly deliveries of supplies stop coming, and the doors of the Maze stay open at night, which allows the Grievers to enter the Glade and hunt the children. Thomas and Minho are the first people in the Glade to survive the night in the maze.
Thomas proposes that the walls of the Maze aren't random, but that their movements are actually a code, leading to the discovery that the Maze is spelling out words. Thomas also discovers that the cliff that they all thought was just a cliff turns out to be where the Grievers leave the Maze or "The Griever Hole" as he and Minho call it. If they can come and go over the edge of the Cliff, then maybe so can the Gladers. This drives Thomas to think they need memories to get out, so he intentionally gets stung by a Griever so he can go through the Changing – the process that people go through after getting the Grief Serum, a syringe of medicine that arrives in the Box along with the other supplies and is administered to people who have been stung by Grievers. The Changing can trigger memories and most often does.
Thomas and the Gladers find out what the pattern is, which causes most of the Gladers to decide to make a run for the exit, knowing that it could be suicidal trying to take on the Grievers, but figuring that nothing could be worse than being stuck in the Glade waiting to be hunted by the Grievers. They succeed, only to find out that they were test subjects in an experiment conducted by an organization called World In Catastrophe: Killzone Experiment Department (WICKED). Gally, one of the Gladers who always knew something was different about Thomas and hated him for it, appears at the laboratory to which the teenagers escape. He hadn't originally escaped with them, and he is acting as though he is being controlled. He moves to throw a knife at Thomas, but Chuck, the youngest Glader and Thomas' friend, jumps in front of him.
After briefly mourning the death of Chuck, all 20 Gladers are rescued by a group of people and brought to a safe haven while being told about catastrophic solar flares that caused an apocalyptic event, followed by a virus called the Flare that killed millions. The rescuers reveal that orphaned children are being tested to find a cure for the virus.
The epilogue is written in the voice of Chancellor Ava Paige—a feature of all the novels in the trilogy. She reveals that the group who rescued the Gladers may just be another variable in the experiment, and that the Gladers weren't the only group being evaluated.