At King's Cross Station, though the rest of the Weasleys reach Platform 9 3/4 without trouble, Harry and Ron find the magical barrier blocked; as a result, they miss the Hogwarts Express. Harry and Ron take the flying car and reach Hogwarts, but accidentally land in the school's violent tree, the Whomping Willow, which damages their car in the process. Ron's wand is broken and the car behaves erratically, ejecting the boys along with their bags and pets before driving itself into the Forbidden Forest. When Harry and Ron enter Hogwarts they are seen by Snape, who scolds them for flying the car to Hogwarts and nearly expels them. Professor McGonagall and Professor Dumbledore arrive and McGonagall defends the boys and tells them they will receive detention only.
Shortly after the start of term, Harry begins hearing an ominous, icy, cold voice coming from inside the walls, starting in his detention with Lockhart. Harry, Ron and Hermione find the message "The Chamber of Secrets has been opened. Enemies of the heir, beware" written in blood across a wall and discover that caretaker Argus Filch's cat has been petrified, who blames it on Harry and attempts to attack him but is stopped by Dumbledore and McGonagall. Legend has it that the Chamber of Secrets can only be opened by the Heir of Slytherin; it is said to be the home of a monster that will only obey the Heir. Harry suspects the Heir is Malfoy. Gilderoy Lockhart, hired to teach Defence Against the Dark Arts, offers a dueling club. At the meeting Draco conjures a snake that Harry discovers he can talk to. Hermione explains that he is a Parseltongue like Salazar Slytherin, a connection that causes the school to believe Harry is his Heir. The three brew Polyjuice Potion to disguise themselves as Malfoy's friends Crabbe and Goyle, and interrogate Malfoy, but learn that he is not the Heir.
In Moaning Myrtle's bathroom, Harry finds a book with nothing written in it that belonged to someone named Tom Marvolo Riddle. Through the enchanted book Harry sees events that happened fifty years ago when Tom was a student. Tom's memories incriminate Hagrid as the Heir, and a girl who died in that era.
Over the course of the school year, Colin Creevey, Justin Finch-Fletchley, the Gryffindor ghost Sir Nicholas and even Hermione are all found petrified, Tom Riddle's diary goes missing, and Harry is injured in a Quidditch match. Harry soon learns that Dobby is the one who sealed the way to Platform 9 3/4 and was also the one who caused Harry's injury. Harry and Ron decide to ask Hagrid, but before Hagrid can answer the real identity of who opened the Chamber, Minister of Magic Cornelius Fudge and Lucius Malfoy arrive. While Ron and Harry hide, the visitors tell Hagrid they are suspending Dumbledore as headmaster and arresting Hagrid under suspicion of having opened the Chamber. Before Hagrid is taken away to Azkaban prison, he tells Ron and Harry to follow the spiders into the Forbidden Forest for the truth. They do so and meet Aragog, a giant spider thought to have killed a student fifty years ago. Aragog reveals that he is not the monster who killed the girl and that Hagrid is innocent. Aragog's sons and daughters attack Harry and Ron, but the flying car rescues them and they escape the forest. After that, the car leaves them again.
Harry and Ron learn from a piece of paper in Hermione's hand that the monster is a basilisk, a giant snake that can kill anyone just by looking at them in plain sight, and overhear the teachers saying that Ginny has been taken into the Chamber and another message has appeared saying "Her skeleton will lie in the chamber forever". Lockhart is sent to find the Chamber and save Ginny, but tries to escape until Harry and Ron caught him. It turns out Lockhart is a fraud; he used memory-erasing charms on witches and wizards to take credit for their accomplishments. The three discover that Moaning Myrtle is the "girl" who died and the chamber's entrance in the bathroom and enter to find a giant snake's skin. After he faints, Lockhart tries to stop Harry and Ron by using a memory charm, but because he used Ron's broken wand, it backfires. Lockhart loses his memory and part of the Chamber caves in, separating Harry from the others and forcing him to rescue Ginny alone. Harry finds Ginny unconscious, and slowly dying, then Tom Riddle appears, explaining that he is a memory preserved in the diary. Tom tells Harry that Ginny Weasley opened the Chamber, sent the basilisk to attack and wrote threatening messages on the walls because he ordered her to. Harry learns that Tom is Slytherin's Heir and is Lord Voldemort in his teenage form. Tom sends the basilisk to kill Harry after telling him that it only listens to Tom but Dumbledore's phoenix, Fawkes, attacks the basilisk's eyes blinding it. Fawkes gives Harry the Sorting Hat, from which he draws the sword of Godric Gryffindor. Although, Harry kills the basilisk by driving the blade up through its head, a fang embeds itself in his arm and poisons him.
Harry destroys Tom/Voldemort by piercing the diary with the fang. Ginny regains consciousness and finds Harry dying, but Fawkes heals Harry's wound with his tears. Dumbledore resumes his post as Headmaster and sends in the paperwork to have Hagrid released from Azkaban. Dumbledore assuages Harry's concerns of his worthiness to belong to Gryffindor House by pointing out that only a true member could have summoned Godric's sword. Learning that Lucius gave the diary to Ginny and that Dobby serves the Malfoys, Harry tricks Lucius into freeing him from servitude. At the year-end feast, Hermione along with all of the basilisk's victims are back to full health, and Hagrid receives a standing ovation as he returns to Hogwarts.
In a post-credits scene, a new Gilderoy Lockhart book is on display at Flourish & Blotts, entitled "WHO AM I?" and depicting an amnesiac, confused Lockhart in a straitjacket.