As Lord Voldemort retrieves the Elder Wand from Albus Dumbledore‘s tomb, Severus Snape has become Hogwarts‘ headmaster. Meanwhile, after burying Dobby, Harry Potter speaks with the goblin Griphook about breaking into Bellatrix Lestrange‘s vault at Gringotts bank, suspecting that a Horcrux may be hidden there. Griphook agrees to take Harry, Ron, and Hermione to the vault in exchange for the Sword of Gryffindor. Harry asks Ollivander, the wandmaker, to identify two wands they took from Malfoy Manor. Ollivander says they belonged to Bellatrix and Draco Malfoy, but Malfoy has changed his allegiance to a different wand.
Finding a single hair of Bellatrix’s on her clothes, Hermione uses polyjuice potion in order to disguise herself as Bellatrix as part of the plan to break into the Lestrange’s vault in Gringotts. She uses the wand Harry obtained from Malfoy Manor and alters Ron’s apperance while Harry and Griphook hide under Harry’s invisiblity cloak. In Bellatrix’s vault, Harry discovers that the Horcrux is Helga Hufflepuff‘s Cup. He obtains the cup but Griphook takes the sword and abandons the trio, leaving them cornered by the alerted security. However, the three release the dragon guardian and flee. Harry has a vision of Voldemort furiously killing goblins, including Griphook, and learns that he has discovered the theft. Harry also learns there is a Horcrux at Hogwarts, that is in some way related to Rowena Ravenclaw. The trio apparate intoHogsmeade, which sets off caterwauling alarms. They are rescued by Aberforth Dumbledore, who instructs a portrait of his younger sister, Ariana, to fetch Neville Longbottom, who leads the trio through a secret passageway into Hogwarts. In the Room of Requirement, the trio are reunited with Dumbledore’s Army and request their help to find Rowena Ravenclaw’s diadem.
Snape hears of Harry’s return and informs staff and students of the severe punishment for aiding Harry. Harry confronts Snape about Dumbledore’s death, and Minerva McGonagall challenges Snape to a duel. Snape flees and McGonagall gathers the community of Hogwarts to prepare for battle. At Luna Lovegood‘s insistence, Harry speaks to Helena Ravenclaw‘s ghost. She reveals that Voldemort performed “dark magic” on her mother’s diadem, which is in the Room of Requirement. Ron and Hermione go to the Chamber of Secrets, where Hermione destroys Helga Hufflepuff‘s Cup with a Basilisk fang, after which Ron and Hermione share their first kiss. In the Room of Requirement, Draco Malfoy, Gregory Goyle and Blaise Zabini attack Harry, but Ron and Hermione intervene. Goyle casts a Fiendfyre curse but falls to his death, however, Malfoy and Blaise are saved by the trio before destroying the Ravenclaw diadem. As the school is attacked by Voldemort’s forces, Harry, again looks into Voldemort’s mind, to locate him and his snake, Nagini, which he knows as the final Horcrux. After entering the boathouse, the trio witness Voldemort telling Snapethat since Dumbledore was the Elder Wand’s previous owner and Snape killed Dumbledore, the Elder Wand cannot properly serve him until Snape dies, and has Nagini murder Snape. Before dying, Snape tells Harry to take his memories to the Pensieve. Fred, Lupin, Tonks and Lavender are killed in the battle.
From watching Snape’s memories in the Pensieve, Harry learns that Snape was a childhood friend of his mother Lily at a young age, and that he had loved her his whole life. Following her death, Snape agreed with Dumbledore to protect Harry from Voldemort out of his love for Lily. Harry also learns that Dumbledore’s death at Snape’s hands was planned between them. Harry became a Horcrux when Voldemort originally failed to kill him and he must die in order to destroy the piece of Voldemort’s soul within him.
Harry goes to die at the hands of Voldemort in the Forbidden Forest, after being comforted by the appearance of his parents, Sirius, and Remus from the Resurrection Stone which was hidden in the Golden Snitch. Voldemort casts the Killing Curse upon Harry, who finds himself in a strange limbo where Dumbledore’s spirit meets him and explains that the part of Voldemort within Harry was killed by Voldemort’s own curse and that “Help will always be given at Hogwarts to those who deserve it.” Harry decides to return to his body to face Voldemort for the final time.
Voldemort announces Harry’s death to everyone at Hogwarts, and that anyone who defies him will be killed. As Neville gives a speech, Harry reveals that he is alive. Neville draws forth the Sword of Gryffindor from the Sorting Hat, and as Harry and Voldemort duel in the courtyard, Neville decapitates Nagini, rendering Voldemort mortal. Molly Weasley kills Bellatrix in the Great Hall after Bellatrix attempts to kill Ginny Weasley and avenges the deaths of Sirius, Nymphadora and Dobby. Voldemort casts his final Killing Curse at Harry, but his curse rebounds and kills Voldemort once and for all. Harry is joined by Hermione and Ron, and Harry explains that the Elder Wand had recognised him as its master because he had disarmed Draco at Malfoy Manor, who in turn had disarmed its previous owner, Dumbledore. Harry snaps the Elder Wand, rejecting its power.
Nineteen years later, Harry and Ginny Potter, along with Ron and Hermione Weasley, watch proudly as their children leave for Hogwarts.