A teenage boy wakes up in an elevator with no memory of his past, other than that his name is Thomas. When the elevator doors open, he is pulled into a glade by a bunch of teenage boys who also have no memories besides what they should be called.
Thomas gradually discovers that the Glade is run by two boys, Alby and Newt, who maintain order by enforcing strict rules. Outside the Glade is the Maze, a labyrinth of high walls covered in ivy that houses strange, lethal creatures known as Grievers. The boys are trying to stay alive as well as "solving" the Maze by running through it as fast as they can while tracking movements of the walls and trying to find an exit.
After Thomas's arrival, a girl is delivered through the elevator into the Glade, and subsequently lapses into a coma. To make matters worse, her arrival triggers everything in the Glade to change: the sun disappears, the deliveries of supplies stop coming, and the doors of the maze stay open at night which allows the Grievers to enter the Glade to hunt the children.
Minho 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 are coming from. If they can come and go over the edge of a cliff, then maybe so can the boys.
The girl, Teresa, wakes up and tells Thomas that they knew each other before they were put in the Glade, and reveals that they can communicate telepathically.
A large group of the teenagers decide to make a run for it, knowing that it could be suicide trying to take on the Grievers but figuring that nothing could be worse than being stuck in the Glade. They succeed, only to find out that what they've been doing is an experiment being conducted by the Creators, a group called "World In Catastrophe: Killzone Experiment Department" (WICKED). The boys and Teresa are "rescued" by rebels and brought to a safe haven while being told about "the Flare"—an apocalyptic occurrence that killed off half of the world's population.
The epilogue reveals that the "rebel group" may just be another variable in the experiment, and they weren't the only group being evaluated.