Harry Potter and the Chamber of Secrets starts at Privet Drive, where Harry's Uncle Vernon and Aunt Petunia are preparing for a meeting with one of Vernon's potential clients. For the meeting, Harry is supposed to stay up in his room and out of the way, so as not to mess up anything. So Harry prepares to do as he is told, but then he finds Dobby, a house elf, in his bedroom. Dobby tells Harry not to go to Hogwarts that year because he would be in great danger there; Dobby had been instructed not to tell anyone that information, though, so he had to punish himself because that is what house elves are required to do when they break rules. His punishing of himself makes a lot of noise, though, which upsets Vernon. Dobby then reveals that he had been taking all of Harry's mail from his friends, which makes Harry angry. Harry then chases Dobby downstairs, where Dobby ends up using magic to drop Petunia's pudding on the heads of Vernon's guests. Enraged, Vernon locks Harry in his bedroom and puts bars on his windows, saying that Harry was not allowed to go to school. But Fred, George, and Ron Weasley arrive in a flying car to rescue Harry, and they take him back to their house to wait for school to start.
When they reach the Weasley house - the Burrow - Mrs. Weasley is furious at her sons for taking their father's car and risking being seen. Later, everyone plans to go to Diagon Alley to get their school supplies, but they will be traveling by Floo powder, which Harry had never used, so he accidentally ends up in Knockturn Alley, but he runs into Hagrid there, and is taken back to Diagon Alley and to the Weasleys. In Diagon Alley, Harry meets his new Defense Against the Dark Arts professor, Gilderoy Lockhart, who insists on a photo shoot with Harry during his book signing. After that, Harry and the Weasleys have a run-in with Lucius and Draco Malfoy; Mr. Weasley and Lucius Malfoy almost get in a fight.
A few days later, they get to King's Cross station a little late, so they are all in a hurry to get on Platform 9 3/4. Harry and Ron are the last two to try, but they find that the platform is sealed, so they end up taking Mr. Weasley's flying car to the school, where they crash into the Whomping Willow and get in a lot of trouble, but only get detentions rather than being expelled.
Lockhart proves himself to be a terrible teacher, who was more concerned with the attention his new position as professor brought him rather than teaching the class. As Quidditch starts, they realize that Draco Malfoy was the new Seeker for the Slytherin team. After calling Hermione a 'mudblood', Ron tries to curse Draco, but ends up cursing himself. Harry serves his detention with Lockhart, helping the bumbling professor answer his fan mail; and while he does that, he hears a strange whispering voice talking about wanting to kill people, but no one else hears it.
Halloween comes around, and instead of going to the big feast, Harry, Ron, and Hermione go to Nearly Headless Nick's deathday party, during which Harry hears the strange whispering voice again. That night, Filch's cat, Mrs. Norris, ends up petrified, with a message on the wall saying, "The Chamber of Secrets has been opened. Enemies of the heir, beware." Hermione recognizes the name, and she asks Professor Binns to tell the class about the Chamber. Since the Chamber is associated with Slytherin, Harry, Ron, and Hermione suspect that Draco is the one who opened it, so they come up with a plan to make Polyjuice Potion to ask him about it.
During the Gryffindor-Slytherin Quidditch game, Harry encounters a rogue Bludger, which was cursed to follow specifically him around. He manages to catch the Snitch, but the Bludger hits his arm and breaks it. Lockhart tries to fix it, but ends up ridding Harry of all the bones in his arm, so Harry ends up in the Hospital Wing that night while Madam Pomfrey regrows the bones. While there, Dobby shows up and reveals that he was the one who enchanted the Bludger and tries once more in vain to convince Harry to leave the school. Harry refuses again, but before he could get any answers from Dobby, Colin Creevey, a first year Gryffindor who had been following Harry around, was brought in petrified like Mrs. Norris, which prompts Dumbledore to announce that he is afraid that the Chamber of Secrets had been opened again.
Once he is out of the Hospital Wing, Harry finds Ron and Hermione in Moaning Myrtle's bathroom, working on the Polyjuice potion. Later, the three sign up to join Lockhart's dueling club. Harry duels Malfoy, and when Malfoy sets a snake on Harry, Harry speaks to it in Parseltongue, telling it not to attack another student, but as no one else spoke the language, they thought he was egging the snake on. Parseltongue was something Slytherin could do, so people started to fear that Harry was the one who opened the Chamber of Secrets. That same night, he finds Nearly Headless Nick and the student who was almost attacked by the snake - they had been petrified. McGonagall finds him with the two petrified people and takes him to Dumbledore's office.
When the Polyjuice potion is finally finished, Harry and Ron turn into Crabbe and Goyle, Malfoy's goons, and go to question Malfoy, where they learn that he is not responsible for opening the Chamber. A few days later, Harry gets Tom Riddle's diary from Moaning Myrtle's bathroom, and after extensive examination of the book, it shows Harry one of Tom Riddle's memories: the time when Moaning Myrtle died, and then Tom caught Hagrid with a giant spider in the castle and blamed Hagrid for opening the Chamber.
Just as the Gryffindor-Hufflepuff Quidditch game is about to start, McGonagall cancels it and tells Harry and Ron that Hermione and another girl had been petrified outside of the library. After that, there were no more extracurricular activities, and students had to be escorted everywhere by professors. Because of the new rules, Harry and Ron use Harry's invisibility cloak to go visit Hagrid. While they are there, Cornelius Fudge arrives to tell Hagrid that he had to go to Azkaban for opening the Chamber again, though Hagrid protests his innocence. Dumbledore sticks up for Hagrid, but then Lucius Malfoy shows up and says that Dumbledore had been removed from his post as Headmaster and had to leave the school. So both Hagrid and Dumbledore left, but not before Hagrid announced to Harry and Ron, who were hiding beneath the invisibility cloak, that if they wanted answers, they needed to follow the spiders.
Harry and Ron listen to Hagrid and go into the forest, following all the fleeing spiders to their leader, Aragog, who was a giant Acromantula (a huge spider). It told Harry and Ron that it was not responsible for the deaths either 50 years ago or then. Harry and Ron later go to visit Hermione in the Hospital Wing and find that she has a paper in her hands about a creature called a Basilisk with the word "pipes" written on it. They go to tell a teacher about what they know, but then they were stopped when there was a gathering of teachers around a new message on the wall, saying that Ginny had been taken down into the Chamber.
When Lockhart boasts that he knows where the entrance to the Chamber is, he is tasked with retrieving Ginny, so Harry and Ron go after him to tell them what they knew. But it turns out that Lockhart was lying, and he was preparing his things to leave the school, so Harry and Ron pull their wands on him and force him to accompany them into the Chamber, the entrance of which they had figured out was in Moaning Myrtle's bathroom.
They go down into the Chamber and Lockhart takes Ron's wand. He tries to curse Harry and Ron, but Ron's wand had been broken at the beginning of the year, so the curse backfired, separating Harry from Ron and Lockhart. Harry goes off on his own to get Ginny back and finds that Tom Riddle has taken form and is draining Ginny's life force to make it permanent. Tom Riddle then reveals that he is actually a teenage Voldemort, and his soul had been preserved in the diary, then he sets the basilisk on Harry. Fawkes, Dumbledore's pet phoenix, then arrives in the Chamber and blinds the basilisk so that it can't kill Harry with its stare. It also drops off the Sorting Hat with Harry, out of which Harry pulls the sword of Gryffindor, which he uses to kill the basilisk. When he does that, a fang from the basilisk is lodged in his arm, which he uses to stab the diary and kill Tom Riddle. Fawkes uses his tears to heal Harry, and everything is okay.
Dumbledore returns now that the Chamber has been dealt with, and Harry tells him, the Weasleys, and McGonagall everything that happened. While he's doing that, Lucius Malfoy arrives with Dobby, who is his house elf, and it is figured out that Lucius Malfoy is responsible for giving Tom Riddle's diary to Ginny. So Harry sneaks one of his socks into the diary and gives it back to Lucius, who then hands it to Dobby to carry. To set a house elf free, the master has to give them clothes, so in giving Dobby the diary, he gave Dobby a sock, which set Dobby free. Lucius tried to curse Harry, but Dobby stopped him. Then all the students go home for the summer.