After a marvelous year at Hogwarts School of Witchcraft and Wizardry, Harry Potter is stuck spending summer break with his awful Muggle (non-wizard) aunt and uncle, Petunia and Vernon Dursley, and his equally horrid cousin, Dudley. On July 31, it's Harry's birthday, but no one remembers. All the Dursleys care about is their guests for the evening: important clients for Uncle Vernon's drill business. Uncle Vernon tells Harry to sit in his room and pretend he doesn't exist – he doesn't want Harry's freakishness (i.e., magic) wrecking his business. When Harry retreats to his room to stay out of the way, though, he finds someone unexpected waiting there: a house-elf named Dobby.
House-elves are bound in servitude to wizarding families. This particular house-elf has sneaked away from his Dark wizard family to warn Harry that something bad is coming to Hogwarts this school year. Harry can't go back to Hogwarts for his own safety; Dobby is determined to keep the Boy-Who-Lived alive. Harry doesn't care about random threats from the arch-nemesis who killed his parents, Lord Voldemort; he just desperately has to get away from the Dursleys and back to his best friends at school. Dobby is disappointed Harry won't promise not to return to Hogwarts. So Dobby takes desperate measures: he casts a charm that ruins the Dursleys' dinner party. Uncle Vernon loses his deal, and he blames Harry. So Uncle Vernon shuts Harry up in his bedroom with bars on the windows. He promises Harry will never get out.
However, Uncle Vernon doesn't count on the inventiveness of Ron Weasley, one of Harry's best friends, and his two brothers, Fred and George. They come flying up to the bars on Harry's windows in an enchanted car belonging to their father. They pull the bars from the windows and help Harry to escape. They bring Harry back to the Weasley household at the Burrow. Harry has an awesome time there until school starts, especially once he and Ron go into London to buy school supplies and meet up with their other best friend, Hermione Granger.
In Diagon Alley, the main wizarding street in London, Harry, Ron, and Hermione go to Flourish and Blotts (a bookstore) to buy their school textbooks for the year. The store is hosting a book signing by the new Hogwarts Defense Against the Dark Arts teacher, Professor Gilderoy Lockhart. Professor Lockhart seems excessively vain and self-conscious; he immediately zeroes in on Harry as the famous Boy-Who-Lived and tries to use Harry's fame to get more attention for himself from the Daily Prophet newspaper. At Flourish and Blotts is also Harry's main school enemy, Draco, and his father, Lucius Malfoy. Lucius Malfoy gets into a fight with Mr. Weasley over Mr. Weasley's poverty and low social standing. The owner of the store finally has to break it up.
Harry and Ron arrive at King's Cross Station to take the Hogwarts Express with the other Weasley kids who attend Hogwarts: Ginny, Fred, George, and Percy. But Harry and Ron can't get through the magical barrier to Platform 9 3/4. In a panic that they have missed the train to Hogwarts, they decide to take Mr. Weasley's flying car to Hogwarts. They succeed in reaching Hogwarts mostly safe (though they are spotted by some Muggles, which is strictly against wizard law), but the car loses power and crashes into a violent tree called the Whomping Willow. Harry and Ron survive, but the car is fed up and rolls off into the Forbidden Forest.
Harry and Ron get into huge trouble for arriving late at school and coming in a flying car. What's more, Ron snapped his wand in the crash, so his spells become unpredictable and undirected for the rest of the year. They don't get expelled, though, which is the important thing. Ron misses the Sorting of his younger sister, Ginny, who ends up in Gryffindor House, just like Harry, Ron, and Hermione. Ginny is very shy around Harry, but she clearly has a huge crush on him.
Harry starts to notice strange things around the castle: he hears a voice that no one else can hear, which talks about tearing, ripping, and killing. Harry worries that he is starting to lose his mind. Things come to a head when he, Ron, and Hermione are coming back from a ghost party on Halloween night. They find a huge pool of water on the floor. There is a creepy message painted on the wall: "THE CHAMBER OF SECRETS HAS BEEN OPENED. ENEMIES OF THE HEIR, BEWARE" (8.163). As well, Mrs. Norris, a cat who belongs to the Hogwarts caretaker, is hanging by her tail from a torch bracket. Her eyes are wide open, but she is stiff as a board. The whole school suddenly starts to suspect that Harry is responsible for this event.
The school's suspicions increase when Harry duels with Draco during the first (and last) meeting of Professor Lockhart's Dueling Club. Draco makes a snake appear, and the snake turns to attack a Hufflepuff second year, Justin Finch-Fletchley. Harry tells the snake to stop without ever realizing that he's speaking to it in Parseltongue, snake language. The ability to speak to snakes is one of the things Salazar Slytherin, one of the founders of the school and the supposed creator of the Chamber of Secrets, was known for. Because none of the other kids can understand Parseltongue, they suspect that Harry was encouraging the snake to attack Justin because Justin is a Muggle-born and not a pureblood wizard. The whole school starts to believe that Harry is the Heir of Slytherin who has opened the Chamber.
It doesn't help matters that the next victim of whatever is happening at the school is Justin Finch-Fletchley. Harry finds him Petrified on the ground along with Gryffindor ghost, Nearly Headless Nick. All of the Hufflepuffs (and many of the other students at Hogwarts) think that Harry must have been the one to attack Justin. When Colin Creevey, a Gryffindor first year who has been annoying Harry with his constant photographs, turns up Petrified as well, the school takes this as definite evidence that Harry has been up to no good.
Meanwhile, Harry, Ron, and Hermione have been trying to find the Heir of Slytherin on their own. They reason that the flood of water at Mrs. Norris's attack came from a nearby bathroom. The bathroom is haunted by the ghost of a former Hogwarts student, Moaning Myrtle. She didn't see anything from that night, though. Because Moaning Myrtle has such an awful personality, her bathroom is always empty. So Harry, Ron, and Hermione decide to use it as a base to create Polyjuice Potion. Polyjuice Potion allows you to take the shape of another person for an hour, as long as you have a hair from him or her to add to the potion at the last minute. Harry, Ron, and Hermione think that Draco Malfoy is behind the attacks, so they decide to take the shapes of his Slytherin friends to get a confession out of him.
They are finally able to collect all of the ingredients and finish the potion by Christmas break. Harry and Ron change successfully into Draco's two dim-witted best friends, Crabbe and Goyle. But Hermione's potion has gone wrong. She used a hair from the robes of Millicent Bulstrode in her potion, but the hair turns out to have been cat rather than human. Hermione sprouts hair from her face and grows cat ears and a tail. Harry and Ron break into the Slytherin Common Room to talk to Draco, but they find out (disappointingly) that he's not the Heir to Slytherin. He does tell them that the Chamber was last opened fifty years ago, and that time, a Muggle-born died.
After this failed attempt at tracking down the Heir of Slytherin, things die down a bit at Hogwarts. There are no new attacks and Hermione returns to her normal human shape. Then, Harry finds out that Moaning Myrtle's bathroom has flooded again. Apparently, someone threw a blank diary into her toilet. Harry takes the diary and discovers that it once belonged to a Hogwarts Head Boy, Tom Riddle. Riddle enchanted the diary to hold on to some of his memories. When Harry asks the diary what happened fifty years before with the Chamber of Secrets, Riddle shows him that it was Hagrid, the current Hogwarts groundskeeper, who was keeping a monster secret in the castle. Harry loves Hagrid, so he doesn't want to believe it's true. Yet he knows that Hagrid has a weak spot for scary creatures, so Harry suspects that Hagrid was the one to open the Chamber the first time.
Just before his Quidditch match against Hufflepuff, Harry hears the voice in the walls again. Hermione has some kind of breakthrough and rushes to the library to research more, but she is Petrified before she can tell them what she realized. Now that Hermione is the fourth student attacked, things have come to a crisis point. Harry and Ron decide to sneak down to Hagrid's hut to confront him.
While they are at Hagrid's hut, a knock comes at the door. Under the cover of Harry's Invisibility Cloak, Ron and Harry watch Cornelius Fudge, the Minister of Magic, come to arrest Hagrid. Fudge has no evidence, but he's under a lot of pressure from the school governors, and that was what Hagrid was expelled from Hogwarts for fifty years ago. As Hagrid leaves for Azkaban prison, he announces loudly that people should be watching the spiders if they want to learn something useful. Lucius Malfoy also appears to tell Professor Dumbledore that the school governors have voted to remove him from office in wake of these attacks. So Hogwarts is left without Hagrid or Dumbledore, its Headmaster. Harry and Ron return to the school truly discouraged.
Harry grows more and more determined to find out what is causing these attacks. Following Hagrid's instructions, Harry and Ron track a line of spiders from the castle into the Forbidden Forest. They arrive at a hollow in the ground where the monster Hagrid did bring to the castle, a huge spider called Aragog, confirms that he was not raised in the Chamber of Secrets. Aragog also never killed anyone. He is willing to let his children (other huge spiders) eat Ron and Harry, though. After barely escaping with their lives, Harry and Ron make it back to Hogwarts. They know Hagrid is innocent, but they don't know what to do next. Harry suddenly realizes: could the girl who died in the first Chamber of Secrets attacks have been Moaning Myrtle?
Harry and Ron try to go to Moaning Myrtle's bathroom, but Professor McGonagall (head of Gryffindor House) finds them. They claim that they were going to visit Hermione in the Hospital Wing, since they don't want to get into trouble for looking for the Chamber of Secrets. Professor McGonagall is moved and lets them go. In the Hospital Wing, Harry notices that Hermione has something clenched in her fist. It's a description of a monster called a basilisk, a giant venomous snake that can kill just be looking at you. Harry realizes that the monster in the Chamber of Secrets must be a basilisk, since none of the people who were Petrified looked at the basilisk directly. The fact that none of them made eye contact with the basilisk is the only thing that saved their lives. Harry can speak Parseltongue (snake language), which is why he heard it talking as it moved through the pipes of the school.
Harry and Ron discover that the basilisk has actually physically taken a student down into the Chamber of Secrets: Ginny Weasley. They decide to help bring her back. They go and find Professor Lockhart, who, as Defense teacher, is supposed to be going to fight the monster. However, Professor Lockhart is actually packing to run away. He has boasted all year of his great deeds, but he's actually a giant liar. Ron and Harry use their wands to force Professor Lockhart in front of them as they go to look for the Chamber of Secrets in Moaning Myrtle's bathroom.
Moaning Myrtle tells Harry and Ron that she died looking into a pair of golden eyes. They realize that she was murdered by the basilisk, and that it came out of a pipe at the sinks against the wall. Ron spots that one of the taps is shaped like a snake. Harry commands it to open in Parseltongue, and the sink opens to reveal a tunnel to the Chamber of Secrets. As Harry, Ron, and Professor Lockhart continue down the tunnel, Professor Lockhart tries to cast a Memory Charm to give Harry and Ron amnesia and save his own life. But he is using Ron's wand, which is broken. The wand backfires and Professor Lockhart is hit with his own curse. The force of the hex half-collapses the tunnel. Harry is trapped on one side of the tunnel facing the Chamber, while Ron and Professor Lockhart are on the other. Harry continues onward alone.
Harry finds Ginny unconscious in the Chamber of Secrets. Near her is the blurry figure of Tom Riddle. Riddle finally explains that he has been using his diary to gain control of Ginny for much of the year. He is able to take physical form now because he is feeding off Ginny's soul. He lied when he told Harry that Hagrid was the one to open the Chamber of Secrets; it was actually Riddle himself when he was a student at Hogwarts. Riddle forced Ginny to go into the Chamber in order to lure Harry to him, since he wants to talk to Harry. Riddle has discovered that Harry is famous for defeating Voldemort as a baby. He wants to know how Harry did it, since Harry was just a baby and Voldemort was the greatest wizard who ever lived. Riddle knows that this is the case because he is Voldemort: "I Am Lord Voldemort" is an anagram for Riddle's full name, "Tom Marvolo Riddle."
Harry tells Riddle that he escaped with his life because his mother scarified her life for Harry, leaving him protected by her love. Riddle's wrong, though, if he thinks he's the greatest wizard that ever was. Harry says Professor Dumbledore is the greatest wizard. After this show of faith, Professor Dumbledore's phoenix appears carrying the Sorting Hat to Harry. The Sorting Hat gives Harry a ruby-colored sword, which Harry uses to stab the basilisk through the head. The basilisk bites Harry at the same time, leaving Harry dying in the Chamber. The tears of Dumbledore's phoenix bring Harry back to life, and he uses the basilisk fang to stab Riddle's diary and get rid of his spirit. Once the diary is destroyed, Ginny wakes up and she and Harry struggle back up the tunnel to Hogwarts.
With Harry's heroic deeds, the school is reopened and Professor Dumbledore returns. Professor Dumbledore tells Harry that he can speak to snakes because Voldemort can; when Voldemort tried to kill Harry eleven years ago, he left a bit of his power in Harry. Even so, this doesn't mean that Harry is going to become the next Voldemort. Professor Dumbledore confirms that Harry is truly a Gryffindor: he drew Gryffindor's sword out of the Sorting Hat. Harry has chosen to follow the path of good, which separates him from Voldemort.
During Harry's conversation with Professor Dumbledore, Lucius Malfoy walks in, accompanied by his abused house-elf, Dobby. He's furious that Professor Dumbledore has come back to the school. Since the other school governors have asked Dumbledore to return, though, there is nothing Lucius can do. In that moment, Harry realizes that it was Lucius Malfoy who slipped Ginny the diary during his fight with Ginny's father at Flourish and Blotts in the beginning of the novel. Dobby had been trying to protect Harry from his own master's evil behavior.
Harry hands the diary back to Lucius covered in one of his filthy socks. Lucius rips the sock off in a fury. As he throws the sock down, Dobby the house-elf catches it. Dobby has been serving the Malfoys against his will all of this time. By the terms of the house-elf's enslavement, if the master presents the house-elf with clothes, the house-elf can go free. When Lucius lets go of the sock and Dobby takes it, Lucius is accidentally freeing his house-elf. When Lucius realizes how Harry has tricked him into letting Dobby go, Lucius tries to curse Harry. Now that Dobby is free, though, he protects Harry from Lucius before disappearing from the castle.
By the end of Chamber of Secrets, Lucius Malfoy has been fired from being school governor, Professor Lockhart has gotten amnesia from his own backfired memory charm, Dobby the house-elf is free, Ginny is liberated from Tom Riddle's possession, and Harry has figured out that he is a true Gryffindor. All's well that ends well!