As a citizen of the Society, Cassia has always trusted the government's choices for her life. They determine when, what and how much she will eat. They monitor her sleep, work and exercise. They even determine the man she will marry. On the night of her 17th birthday, she nervously boards the air train with her parents. It will take them to her Match Banquet where she will be paired with the perfect mate for her. He may come from any of the Society's cities, and her first introduction to him will be via a television screen in the banquet hall. After that, she will receive a microcard containing pertinent information regarding her future husband. Her best friend, Xander, assures her that everything will work out for the best.
After a dinner Cassia barely eats, the ceremony begins. When her name is called, she stands and watches the large screen. But it remains blank. A voice tells her that her match is actually in the room. To her relief, and happiness, the Society has picked Xander as her mate. It is rare that one's mate is found in the same city and neighborhood, but Cassia is thrilled.
Her excitement doesn't last long, though. The following evening, when she has the house to herself, Cassia watches the microcard of her match. At first, Xander's picture appears, and she listens to a recorded message about him. Before she can change the screen to read about their Courtship Guidelines, the picture of another boy she knows, Ky Markham, appears on the computer screen.
The following day, an Official of the Society speaks to Cassia in private. She explains that a rare mistake happened in the Matching Department. She assures Cassia she need not worry. Xander is her match. In fact, Ky is not allowed to marry anyone, as he is an Aberration, a person that must remain single because he or his family has committed an infraction. In Ky's case, his father committed the infraction. Even though Ky's aunt and uncle raised him, the Society can't overlook his father's actions. The Official exchanges Cassia's microcard for a new one and asks her to keep the mistake a secret. Cassia asks that she be allowed to speak to her grandfather about the incident. The Official agrees, as her grandfather is scheduled to have his Final Banquet the following night.
In the Society, people are allowed to live until their 80th birthday. At that time, they are served a final meal of their choice and die. Cassia visits her grandfather and tells him what happened with her first microcard. When she asks him how her grandmother would have reacted, he says she would have asked Cassia if she wondered if it really had been a mistake. He also asks Cassia to bring the artifact he'd given her. It is a compact that belonged to her grandmother. He wants to see it on the night of his Final Banquet.
Cassia and her family spend the following day with her grandfather. The Committee visits them and instructs the family on how to collect a tissue sample and give it to the Biological Preservation Department within 24 hours. Her grandfather has been given the honor of being preserved in the hope that the Society might one day be able to bring back the dead. Her grandfather is also given a microcard with pictures of his life. It must be returned after his death. After a final meal, in which her grandfather eats only desserts, the family takes turns saying goodbye. Cassia's father goes first. Then Bram, her younger brother, says his farewell, followed by her mother. Cassia is last. She gives her grandfather a letter she composed by sorting words on her computer. No one in this culture knows how to write anymore. Although grateful for her effort, her grandfather encourages her to trust her own words from now on. Cassia returns her grandmother's compact to him, and he surprises her by opening a secret compartment and pulling out a piece of paper with writing on it. He reads it to himself then hands it to Cassia. She returns it to the compact without looking at the words so no one else notices it. Handwriting such as was on the paper is illegal, but her grandfather has given it to her with the added command to allow herself to wonder. Moments later, with his family around him, her grandfather dies.
The following night, Cassia and her friends search for something to do. Their only options are the game center, music hall or a showing. They decide on a showing, even though they all have seen it before. Ky Markham joins the group and winds up sitting next to Cassia during the movie. She is intrigued by the quiet young man she has been friends with most of her life. She realizes she doesn't really know him. As they watch a government-sponsored movie about the formation of the Society, she risks glancing at Ky. The film absorbs him. Cassia and Xander believe the last scene was overdone. It shows life before the Society. People wander about the dirty, abandoned streets. An airplane flies overhead and fires on the citizens. Cassia thinks the blood and screams are melodramatic until she looks at Ky. He is quietly crying. Unnerved, she turns away. By the end of the film, Ky is composed, giving no indication the movie moved him.
Cassia has signed up for a new summer recreation class. For the first time in many years, hiking is an option. The students are ordered to climb a small hill as quickly as they can. Cassia races up, sure to reach the top first, but before reaching it, hides in the trees so she can read the hidden note in her compact. The note includes forbidden poems. One is "Do Not Go Gentle Into That Good Night" by Dylan Thomas, and the other is "Crossing the Bar" by Alfred Lord Tennyson. The words of the poems speak to Cassia, and she tries to commit them to memory. She hurriedly hides the paper before continuing her trek up the hill, arriving at the top second. Ky has arrived first. The two strike up a conversation in which Cassia learns that Ky's original home in the Outer Provinces was a much harsher place. Ky admits that he saw Cassia reading in the woods. He offers to destroy the paper, but she refuses his help.
That night, Officials come to Cassia's house. She is terrified they have found out about the poems, but they are there because her grandfather's tissue sample was never turned in. Her father claims to have lost it. The Officials are livid, warning that her father will face sanctions at work for his mistake. Cassia decides to take the air train to her father's work site the next morning so she can destroy her grandfather's poems. Her father and his crew are in charge of sorting through artifacts and destroying those that aren't useful to the Society. At this site, he is incinerating books found in an old library. The Society has ordered that only 100 books, 100 songs, 100 pieces of art and 100 poems be preserved from the past. Everything else must be destroyed. Cassia removes the poems from her pocket and lets the paper fly among the other pages about to be burned. That night, Cassia admits to her father what she did. In turn, he admits that he didn't lose her grandfather's sample accidentally. Grandfather asked him to destroy the sample so the Society would never have the chance to remake him. Cassia is crushed by her father's rebellion but realizes she is starting to have doubts about the Society. She vows to forget about the poems and about Ky. She will follow the rules of the Society and remain safe.
But in the days that follow, Cassia finds herself drawn to Ky. He admits he knows how to write and agrees to teach Cassia how to draw her own letters. She, in turn, agrees to share the Thomas poem she's memorized. He also starts to send her messages on stolen napkins in which he reveals more about his childhood. Cassia knows he uses napkins so she can destroy them in her home's incinerator without the Society becoming suspicious. The sensors within the incinerator would notice writing paper, and the Officials would soon be knocking at her door.
The Officials do come to her house again, though, this time looking for her compact. They've decided that in fairness to those who do not have artifacts from the past, those who do must surrender theirs. They will be put on display at a museum. Cassia realizes she will lose not only her compact, but also a compass that Ky secretly gave her. Xander offers to hide her compact from the Officials. At first, Cassia refuses to let him take the risk, but then sneaks Ky's compass to him. Although Cassia has not told him about her feelings for Ky, Xander hides the compass in the flowerbed outside Ky's house.
Cassia's Official pulls her out of school to inform her that she's had the highest score of the year on her job assessment test. Many departments are looking to hire her, but the Official warns her that the Society is watching her relationship with Ky. It is not out of the ordinary for teenagers to have flings outside of their match, but because of Ky's Aberration status, Cassia could be labeled an Aberration herself. She can remain friends with Ky, but nothing more. Ky sends Cassia another message on a napkin. She realizes through the poem and picture he's drawn that the Official has warned him as well. The two try and keep up the appearance that they are only friends while in public, but while they are hiking, their true feelings emerge. Ky gives Cassia a belated birthday present: the stanza of another Dylan Thomas poem. That afternoon the two share their first kiss and the hope that they can find a way to be together.
Cassia is called up for the final test before she is assigned a permanent work detail. She is brought to the Nutrition Department where Ky works. She is ordered to sort out the best workers. Those who score high enough will be transferred somewhere else. Those who score poorly will stay in the Nutrition Department, a taxing job in which most of the workers die young. As she talks to the Official in charge, Cassia realizes that the reason they die early is because they handle the food of the elderly, food that is poisoned so that they die on their 80th birthdays. As Ky has positioned himself to be exactly in the middle of the workers, it is up to Cassia alone to decide his fate. If he remains in the Nutrition Department, he will be slowly poisoned, but the Official won't tell her where the better workers will be transferred. In the end, Cassia puts Ky in with the top employees so that he will be moved to another job.
Cassia admits her feelings for Ky to Xander. He seems to have suspected them but is still hurt by her confession. Ky is transferred early the next morning, not to a new job, but to the Outer Provinces to fight in the army. His adopted mother screams in panic, waking many of the neighbors who then witness him being carted off. Cassia and Ky exchange hand gestures in which she assures him she will find him so they can be together. Officials arrive and order everyone to pull out the tablet containers they carry with them at all times. Inside are three tablets. The blue one will give them nutrients if they are ever lost and in need of food. The green one is a kind of tranquilizer. The Officials order the witnesses to take the red pill. Cassia drops hers to the ground and crushes it beneath her foot. She watches as the others take theirs and soon realizes it wipes away their short-term memories. No one who witnessed the morning's drama will remember what happened. Later that morning, as her family struggles to clear their heads of the drug-induced fog, they receive an Official message. Their family is being transferred to the Farmlands. Her mother knows it is because she filed a report about illegal crops being grown in the Outer Provinces. The Society is banishing them because it does not want anyone else knowing that there is trouble brewing outside of their control.
Cassia does some quick detective work to figure out where Ky might have been transferred. Before her family is moved, she receives a last visit from her Official who informs her that her relationship with Ky was never a mistake. The Society occasionally puts an Aberration in the Matching Pool to observe what will happen. It was a surprise when Cassia turned out to be his Match, so they allowed the experiment to continue to see what the two teenagers would do. The Official offers Cassia a chance to stay in the city if she will reveal more about her relationship with Ky, including those things the Society couldn't see in the woods. Cassia refuses and soon realizes that the Official is lying; the Society didn't put Ky in the Matching Pool, but they did use the mistake to their advantage.
Cassia says goodbye to Xander who knows that she will try and find Ky. He confesses the red pills don't work on him, and he remembers everything that happened that morning. He gives Cassia a going away present of small mementos and several more blue pills that can help her stay alive if she is away from civilization. Their parting is bittersweet, with neither of them knowing what the future will hold for them. On the air train to their new home, her parents tell her they know she's in love with Ky. They inform the Officials that she has been rebellious, not as a punishment, but so she will be transferred to a work detail near where she believes Ky to be stationed. The novel ends with Cassia's hope that she will find him again.