Sixteen-year-old Beatrice Prior lives in post-apocalyptic Chicago where society is divided into five factions: Amity (kind), Erudite (intelligent), Candor (honest), Abnegation (selfless) and Dauntless (brave). Beatrice and her brother, Caleb, must take an aptitude test that will tell them which faction they are best suited for and then choose which they will join. Where they join determines the value they will commit to for the rest of their lives.
During the aptitude test, Beatrice is injected with a serum that simulates several scenarios. She is judged on her reactions to these scenarios. After the test, the administrator tells her the results are inconclusive. Instead of having aptitude for only one faction, Beatrice shows an aptitude for three — Abnegation, Dauntless and Erudite — a result the administrator says makes her Divergent. The instructor warns Beatrice to not share the results with anyone because those who are found to be Divergent are killed.
Beatrice's family belongs to Abnegation, the faction that has run the government since the great peace when the factions were formed. At home, Beatrice's father tells the family that tension between Abnegation and Erudite is high. Erudite leader Jeanine Matthews has released a report saying that Abnegation leader Marcus' abusive behavior toward his son Tobias is the reason Tobias left Abnegation two years earlier and chose Dauntless. They all believe the report is a lie. Beatrice has never met Tobias but knows leaving one faction for another is considered a betrayal. Beatrice believes she is too selfish to remain in Abnegation and secretly admires Dauntless, but she knows if she chooses another faction, she will have to leave her family forever.
At the choosing ceremony the next day, Beatrice is shocked when Caleb chooses Erudite. She intends to choose Abnegation so her parents won't lose both their children, but at the last second, she chooses Dauntless, much to her father's disappointment.
Beatrice travels to the Dauntless compound with other initiates and renames herself Tris. The initiates are told that only 10 of them will succeed, the others will become factionless or homeless with no place in society. Tris befriends Christina and Al from Candor and Will from Erudite. Peter, Drew and Molly, three others in their group, bully her.
The group's Dauntless instructor, Four, teaches them how to use guns and knives, and to fight using hand-to-hand combat in the first stage of their initiation. Tris is simultaneously intimidated and attracted to Four.
Tris' mother comes to the Dauntless compound on visiting day. She warns Tris to stay in the middle of the rankings and to not draw attention to herself because she is Divergent. She also asks Tris to visit Caleb in Erudite and ask him to research the simulation serum. Tris notices that her mother knows her way around the compound and realizes that she is Dauntless-born.
Stage two of Tris' initiation involves conquering fear. As with the aptitude test, initiates are injected with a serum that simulates a frightening situation and measures the teens' ability to remain calm or eliminate the threat. Tris performs well during this phase and eventually realizes that she can control the simulation and change the outcome. Four tells Tris that manipulating a simulation proves she is Divergent and warns her that if she does not hide it, the Dauntless leaders will kill her. He deletes the footage of the simulation.
Tris is more careful but still excels at training, getting through her simulations faster than anyone else. By the end of stage two, she is ranked first among the initiates. Other initiates become jealous, and three of them, including her friend Al, kidnap her and try to kill her. Four saves Tris before she is thrown over a ledge.
Tris and Four draw closer together, and Four takes Tris into a simulation of his fears. Tris discovers that Four only has four fears, hence the nickname. Most initiates have an average of 10 to 15. She also discovers that he is actually Tobias, the Abnegation leader's son and an Abnegation transfer. Four's greatest fear is of his father beating him and locking him in a small closet. After the simulation, Four takes her to the rapids where he tells her that he likes her, and they kiss.
The next day, Tris is disappointed that Four treats her like everyone else in her group. She fails a simulation, and he scolds her. Tris runs away to the Erudite headquarters in search of her brother. She tells Caleb about their mother's visit and asks him to research the simulation serum. Caleb is afraid for Tris. He feels something big is going to happen, but he doesn't know what it is. The Erudite are not happy with the government under Abnegation. As she tries to leave, Tris is arrested and taken to Jeanine, the Erudite leader, who questions her about choosing Dauntless and about her training records. Jeanine developed the serum aptitude tests and simulations, and she is suspicious of Tris' results. Tris tells her that she transferred to Dauntless because she hates Abnegation and her parents. She is allowed to return to the Dauntless compound.
Four explains to Tris that they must keep their relationship a secret or other initiates will think her rank is based on favoritism and not merit. He also tells her that he got into the Dauntless computer system and found war plans from the Erudite. They realize that the Erudite want to use the Dauntless as soldiers in a war against Abnegation.
Tris passes her final test in the Dauntless initiation, a virtual simulation of all her combined fears, and receives the top rank. Afterward, Eric, the Dauntless leader, injects her with what he says is a tracking serum. He tells her that all the Dauntless are getting it as a precaution.
That night, Tris wakes up to find all the other initiates in her dorm getting out of bed in unison and getting dressed. They are in a trance-like state, and she can't wake them. She follows them aboard the train to the Abnegation section of the city. She realizes the serum they received contained transmitters, and the transmitters are connected to a mind-control program. The Erudite developed the serum and the simulations, and the Dauntless leaders are working with Erudite. She is not under the mind control like all the other Dauntless because she is Divergent. She finds Four, who is also awake and pretending to be in a trance. He is Divergent as well.
When they get to the Abnegation sector, they see mind-controlled Dauntless shooting Abnegation members in the street. After a confrontation with a Dauntless leader, Tris is shot in the shoulder, and Eric and Dauntless soldiers capture Tris and Four. They are taken to the Erudite leader who tries a new serum on Four, one made especially for the Divergent, and it turns him into a mindless killer as well. Tris is left to drown in a tank rapidly filling with water, but her mother rescues her. She tells Tris where her father and the other Abnegation are hiding. She distracts soldiers so Tris can get away, but in the process, Tris' mother is killed.
Tris finds her father hiding with her brother and Marcus, Four's father. They agree to go back to the Dauntless compound to find the computer running the mind-control simulation and destroy it. When they get to Dauntless, they find another initiate, Peter, willingly guarding the facility; he is not under any mind control. Tris shoots him in the arm to get him to tell her the location of the computer. Leaving a wounded Peter with Caleb and Marcus, Tris and her father find the computer room and encounter several guards along the way. Her father shoots them, and in the fight, he is killed. Tris finds Four in the computer room monitoring the simulation. She knows she can't shoot him or beat him in a fight, so she reasons with him, hoping that because he is Divergent, he will be able to break free of the simulation, and he does. They stop the computer program and remove the data. The Dauntless group, no longer under mind control, realizes what they have done.
Tris reunites with her brother, and Four faces Marcus for the first time in more than two years. Tris warns Marcus to stay away from Four. They take a train to Amity Headquarters to seek refuge.