Tally Youngblood is living in a dorm in Uglyville, just outside of Pretty Town, where her best friend, Peris, has just moved. Peris just had the city’s mandatory cosmetic surgery to become a “Pretty” and is now living with the other Pretties across the river. Tally is still an “Ugly,” but she is only months away from her surgery. She can’t wait to become a Pretty. Tally believes that, after the surgery, she’ll finally be at peace with herself and will be once again reunited with her best friend.

Tally decides to go on a secret mission to visit Peris. Uglies are not allowed in Pretty Town, so Tally picks up a disguise from a passing parade as she makes her way to Pretty Town. Everyone in Pretty Town parties night and day, and this day is no different. Tally watches as the revelers drink and bungee jump off the two Party Towers that flank Garbo Mansion, where Peris lives. As Tally makes her way through the party, the revelers catch onto her and chase her. She finds Peris in an elevator, who encourages her to bungee jump off the tower to escape. Before Tally leaps, Peris makes her promise not to come back. He doesn’t want her to hurt her chances of getting surgery.

Tally finds another girl on a similar mission, Shay, hiding in the bushes. Shay and Tally strike up a friendship after Shay becomes impressed with Tally’s daredevil antics. They discover they have the same birthday. It seems no one returns to Uglyville after the surgery. Both Tally and Shay wonder why their friends don’t seem to want to contact them anymore once they move. They pledge to remain friends after the surgery.

Shay shows Tally how to use a hoverboard, a flying device that uses magnetization to stay airborne. They decide to do tricks and play games as a last hurrah before heading off to surgery. Shay isn’t as excited about the surgery as Tally. She resists the idea that people aren’t beautiful without the surgery. Shay says she accepts her features and wishes Tally did, too. The night before their surgery, Shay comes to Tally’s room and offers her an opportunity to escape. She says there is a place beyond the Rusty Ruins, the ruins of a prior civilization that went extinct after it became too dependent on oil, where people live without the surgery. Tally politely refuses the offer, thinking Shay is crazy to avoid a life where she could have no worries and be beautiful. 

On the day of Tally’s surgery, the city’s secret police organization, Special Circumstances, comes to pick her up. They tell her there is a problem with her surgery. Tally meets Dr. Cable, a terrifyingly beautiful operative. Dr. Cable says they have been after Tally’s friend Shay for months. They want to know where Shay is headed and want to seize the other runaways. Dr. Cable gives Tally an ultimatum: Help infiltrate the runaways’ camp, or be denied “Pretty” surgery. Tally, overwhelmed by the idea of a lifetime of ugliness and lack of acceptance, reluctantly agrees.

Tally must make the two-week trek to the camp, called the Smoke, alone. She uses Shay’s secret coded instructions to get there. Tally almost drowns in a river after a group of rangers riding a helicopter blow her hoverboard into the river. The rangers are Pretties who are hired to spread fires to kill a highly invasive species of white orchid that was genetically engineered by the Rusties, people who lived during the Rusty Era. They take Tally to the edge of a field and leave her there for the Smokies to pick her up.

Tally is relieved to find her friend Shay alive and well. Dr. Cable has outfitted Tally with a special locket she has to activate with her eye when she’s ready to call in the forces. After meeting David, one of the camp’s leaders, and seeing how the Smokies have an entire way of life, Tally struggles with whether to turn Shay in. David, seeing how serious Tally takes leaving her life behind, takes her to meet his parents, Az and Maddy, who are doctors that used to perform Pretty surgeries on people. Az and Maddy reveal that the surgeries performed in the city involve much more than cosmetic changes—the surgeries also change the way people think. They make people docile. Tally decides to abandon her mission and throws her locket into a fire in a show of affection for David. Tally doesn’t realize, however, that the pendant is activated once it is destroyed.

Special Circumstances raids the Smoke a few hours later, burning it to the ground. Tally and David escape, but the others are captured and taken back to the city. David discovers his parents are missing as well. He and Tally make the trek back to the city. Tally declares she wants to save the others but doesn’t reveal it’s because of her guilt. Once back in the city, she and David infiltrate the Special Circumstances’ headquarters and free the Smokies. David is anguished to learn that his mother survived but not his father. Az died during an experimental procedure to erase his memories. Tally is anguished to learn that Shay has been turned into a Pretty, something Shay was vehemently against.

Back at a makeshift camp at the Rusty Ruins, Maddy uses some of Dr. Cable’s confiscated materials to try to cure those suffering from the brain lesions caused by the surgery. Maddy also tries to get Shay to agree to use the experimental drug she creates. Since Maddy has taken the Hippocratic oath, she can’t make Shay take the drug without consent. Tally decides to turn herself in to get the Pretty surgery so she can be a willing participant in Maddy’s experimental drug. When Tally confesses to David her role in the Smokies’ capture, he runs away, disgusted. She hopes he’ll forgive her after making this one last sacrifice.