The Builders are a coalition of "professionals" - doctors, scientists and architects, and they have assembled in the city of Ember. Ember is a city built by men who believe that the end of the world is coming shortly, and they have constructed it so that it, and its inhabitants, can survive the apocalypse. The city has amassed supplies for Emberians that will last at least two hundred years.
The first mayor of the city of Ember was given a locked box by the original Builders. Inside the box was a set of instructions for the inhabitants of Ember, and it was supposed to be passed down from one Mayor to the next, like a written tradition. The passing down of the box is completed successfully by six mayors, but the chain is accidentally broken by mayor seven, who tries to open the lock but cannot, and who dies of a deadly cough before he can give the box to anyone or leave notes on why it is so important.
The supplies that were amassed by the Builders at the city's inception last as planned, but as the city nears its two hundred and forty first year, supplies are running low, and the city's generator is outdated and wearing out. To be fair though, it was only designed to run for two hundred years.
The city's young people graduate as usual, despite the general air of concern for the future of the city. After graduation they don't set out down their own career paths but take the jobs that are assigned to them, wanted or not. Lina Mayfleet is assigned the role of Pipeworks Laborer. Doon Harrow is to become a Messenger. Neither is happy with their assignments and wanted the positions that the other was given so they exchange assignments in secret later. However, both Lina and Doon soon have a far more important task at hand than either has been given. Lina's little sister, Poppy, is teething, and as well as this is going through a rather adventurous, boundary setting stage. She discovers the hiding place of the Builders' instructions for Ember, but chews on them because she is teething. Lina asks Doon to help her put them back together, and after much work and fiddly cutting and pasting they reconstruct the chewed up papers. The instructions include the secret of how to leave the city of Ember if needs be.
When Lina and Poppy's grandmother passes away, the girls are sent to live with their neighbor, Mrs Murdo. Still close with Doon, Lina reports one of his co-workers, Looper, for stealing supplies, in cahoots with the current mayor. Meanwhile, they discover all of the things that they are told in the instructions are waiting for them to help them escape the city. They find boats, and a huge supply of candles, which will come in handy now that the mayor has declared them fugitives. Lina is immediately arrested and hauled before the mayor who tells her he is sending her to jail, but befre he can do so there is a blackout, and in the ensuing confusion Lina escapes. She meets up with Poppy and Doon, and the three fugitives take a boat and escape downriver. They find a journal kept by one of the original Builders that explains how Ember came to be. It is illuminating and inspires them to keep going.
As the boat comes to a stop at the end of the river, they climb ashore and undertake an exceptionally steep climb . When they get to the top they realize that they have emerged from under the ground. They have never realized this about Ember before - it is an underground city, and for their whole lives they have lived underground and never known it. Ember seems very small when viewed from above. They tie instructions for escape to a heavy rock, and throw it towards the city hoping that a reputable citizen will find it and follow the instructions to help the other good citizens of Ember escape. There is hope; they cannot know this, because it happens too far under the ground for them to see it, but the rock is found by Mrs Murdo, who unties the message containing the instructions, and begins to read.