In a futuristic, dystopian Chicago, society is organized into five factions. Each faction places value solely on a specific virtue, which its members work to cultivate throughout their lives. There is Abnegation, which values selflessness, Amity, which values peace, Erudite, which values knowledge, Candor, which values honesty, and Dauntless, which values bravery. Children are raised in their parents' faction, and once they turn sixteen, they have the option to choose for themselves which faction will be theirs for the rest of their lives, whether it's the one they grew up in or not.
Beatrice Prior is a sixteen-year-old member of Abnegation. She and her brother Caleb, who is not quite a year her elder, take the aptitude test that will tell them which faction they are most suitable for. The test consists of a simulation of a confrontation with a vicious dog. Beatrice shows aptitude for three different factions, Abnegation, Erudite, and Dauntless, and this means she is something called Divergent. She is warned to never tell anyone of her results - it is dangerous to be Divergent. After much contemplation over whether to stay in Abnegation or switch factions, Beatrice chooses to switch to Dauntless, and Caleb moves to Erudite.
In Dauntless, Beatrice changes her name to Tris because she feels it will allow her to start over and become someone else entirely. She makes quick friends with two Candor transfers named Christina and Al, and an Erudite transfer named Will, while three other Candor transfers, Peter, Drew, and Molly, become her enemies. Initiation into this courageous faction involves three stages, and they will be ranked after each one. Only the top ten initiates will become Dauntless members; the rest will fail out and become factionless, forced to live on the streets of the city in poverty. The first stage of initiation involves learning how to fight from their mysterious initiation instructor, Four, and one of the cruel Dauntless leaders, Eric. Because Tris is small, she isn't a particularly adept fighter, but she manages to get by.
Tris earns the respect of many during the initiation tradition of capture the flag, in which she has the idea to climb to the top of a ferris wheel in order to see the other team's location. Four comes with her, and for the first time she realizes the feeling she gets when she's around him. She also earns Eric's respect when she volunteers to take a punishment meant for Al - standing in front of a target while Four throws knives around her.
Visiting Day arrives, and Tris's mother comes to visit her in her new faction. She knows a suspicious amount about the Dauntless compound, which leads Tris to believe that her mother may have originally been Dauntless. She tells Tris to go visit Caleb in Erudite and tell him to research a simulation serum. Tris learns that Abnegation members are now prohibited from entering Erudite. Later that day, Al admits that he likes Tris as more than a friend, but she cannot return the sentiment. When they receive rankings for stage one, Tris is ranked sixth, and is not cut. Peter, however, is unsatisfied with his second place finish, and that night he stabs the first place initiate, Edward, in the eye, forcing him to leave initiation.
As stages two and three of initiation commence, Tris begins to come into her own in Dauntless at last. She goes zip lining down from the Hancock building with the Dauntless-born initiates, shows extreme proficiency in fear simulations, and becomes closer to Four, who slowly starts to open up to her. But tension is brewing between two of the factions, Erudite and Abnegation, and Erudite continuously makes attacks on the Abnegation administration. Initiation is still the most pressing thing to worry about, though, and at the end of stage two she receives a shock; she's ranked number one. Considering her a threat, Peter and Drew attack her with the help of Al, who used to be her friend. Four rescues her before they kill her. Al is devastated with what he's done, and kills himself as a result.
Four at last reveals to Tris his true identity: he is Tobias Eaton, son of abusive Abnegation council representative Marcus. At this point, they officially begin a secret relationship. After a bad day in training, Tris leaves the Dauntless compound without telling anyone. She goes to Erudite to pass on her mother's instructions to Caleb. There, she has a confrontation with Erudite leader Jeanine Matthews, who Tris suspects of colluding with Dauntless to kill the Divergent. When she returns to Dauntless, Tobias warns Tris that Erudite is planning a war against Abnegation and will use Dauntless to fight it.
Initiation day comes, and Tris goes through her final assessment, a simulation containing each one of her fears that she must conquer, one after another. She's extremely successful and ranks first, becoming an official member of Dauntless. However, she later realizes that in the excitement of the day, the Dauntless leaders injected everyone with a simulation serum that day, calling it a tracking device. She knows they must be lying, and that Erudite will use this serum as a simulation to get Dauntless to fight Abnegation for them.
That night, everyone in Dauntless wakes up in a sleepwalking trance except Tris; she can resist the simulation because she's Divergent. Tobias can do the same, and they find each other in the crowd while pretending to be sleepwalking just like the others. But when Eric tries to "accidentally" kill Tobias, the two fight back and are taken to Erudite headquarters, where Jeanine takes Tobias in for simulation testing and sends Tris, who was shot in the shoulder and therefore of no use to her, to be executed. The next morning, Tris is taken to a large tank, similar to the one that appears in her fear simulations, and is to be drowned. However, Tris's mother Natalie rescues her just in time, and takes her to her father and brother. On the way to their hiding place, Mrs. Prior is forced to sacrifice herself in order to ensure that Tris escapes.
Tris realizes the only way to stop the killing is to stop the simulation entirely, so she, her father, her brother, and Marcus Eaton head to the Dauntless control room to shut it down. On the way they come across Peter, who bargains with Tris, saying that if she takes him with her, he'll tell her how to get to the control room. Tris's dad is shot and dies along the way. Tris is devastated, but she keeps going, and eventually makes it to the control room where none other than a serum-controlled Tobias is controlling the simulation. After hearing her voice, he is able to fight off the simulation he's under, and the two turn off the computer and take the data so that the Dauntless will not be able to restart it.
Tris, Tobias, Caleb, Marcus and Peter head out of the city, hoping to find safety in the peaceful Amity compound.