The Order of the Phoenix attempts to take Harry Potter to the Burrow just prior to his seventeenth birthday but are ambushed by Death Eaters. Harry's wand, seemingly of its own accord, countercurses Voldemort, and Harry escapes. Minister of Magic Rufus Scrimgeour gives, Harry, Ron Weasley and Hermione Granger bequests from Dumbledore's will: the Deluminator for Ron, a first edition of a children's book, The Tales of Beedle the Bard, for Hermione, and a golden snitch, bearing the mysterious phrase "I open at the close." for Harry. The Ministry refuses to give Harry Godric Gryffindor's sword, which Dumbledore also left to him.
At Bill Weasley and Fleur Delacour's wedding reception, a Patronus arrives, announcing that Scrimgeour is dead, that the Ministry of Magic has fallen under Voldemort's control, and that Death Eaters are on their way to the reception. Harry, Ron, and Hermione take refuge in 12 Grimmauld Place, which Sirius Black had left to Harry. He realizes that Sirius's brother, Regulus was the "R.A.B." who took the Locket Horcrux. Hermione recalls seeing such a locket in the house. The house-elf, Kreacher, had kept the locket, but Mundungus Fletcher had stolen it from Kreacher and given it to Dolores Umbridge. Using Polyjuice potion, the trio infiltrate the Ministry of Magic and steal the locket, but they are forced to flee to the countryside with no means to destroy it. Harry and Hermione deduce that Gryffindor's sword can destroy Horcruxes which is why Dumbledore attempted to leave it to Harry, and learn that the one kept by the Ministry is a fake. Ron, however, abandons the mission and goes home.
Harry and Hermione look for the sword in Godric's Hollow, Harry's birthplace as well as Godric Gryffindor and Dumbledore's hometown. While there, they find a grave for Ignotus Peverell with a mysterious symbol on it. They are then ambushed by Nagini and Voldemort but escape due to Hermione's quick Blasting Curse which also damages Harry's wand and knocks him unconscious. When he awakens, he and Hermione are in woodland in the Forest of Dean. At night, Harry follows a silver doe-shaped Patronus to a pond containing the real sword of Gryffindor. As Harry tries to retrieve it, the Locket Horcrux (which he is wearing) strangles him. Just then, Ron returns (using a secret power of the Deluminator) and rescues him and the sword. Harry directs Ron to destroy the Horcrux with it and he does. Ron informs him that Voldemort's name is now tabooed: speaking it summons the death eaters. Additionally, Ron supplies Harry with a blackthorn wand that he managed to procure from a group of Snatchers. Harry, Ron, and Hermione visit Xenophilius Lovegood, whom they had seen wearing the symbol briefly discussed at the wedding, in order to learn its meaning. Lovegood explains that it represents the three legendary Deathly Hollows; the elder wand (the most powerful wand in the world), the Resurrection stone (which can bring back the dead), and the Invisibility Cloak (a true invisibility cloak that never wears out)-- discussed in a story The Tales of Beedle the Bard that uses that symbol. According to the story, three brothers took these as "gifts" from Death. Lovegood tells them that believers in the Hallows think that the three brothers were the three Peverell brothers. Harry realizes that Luna is suspiciously absent, and Lovegood admits that Death Eaters have abducted his daughter and are coming for Harry and his friends now, desperately hoping against hope that by doing so, Luna will be returned to him unscathed. The trio barely escapes.
Despite Ron and Hermione's skepticism, Harry believes that Dumbledore's gifts indicate that the Deathly Hollows are real and that Dumbledore had all three (although, amazingly by his own knowing actions, not at the same time- therefore he is not considered to be a Master of Death). They include Harry's Invisibility Cloak and the ring Dumbledore was wearing (the Resurrection stone), which is probably inside the snitch. He concludes Voldemort is pursuing the Elder Wand which was buried with Dumbledore at Hogwarts. Harry then accidentally speaks Voldemort's name and the trio are captured and taken to the cellar of Malfoy Manor, with Harry disguised. Finding Gryffindor's Sword, Bellatrix Lestrange fears the trio broke into her Gringotts vault and Harry deduces that something else of Voldemort's is in the Lestrange vault. She tortures Hermione for information. Harry calls for help using a two-way mirror piece, in which he sees an eye. Dobby then apparates into the cellar and rescues the other prisoners, including Luna, the goblin Griphook and wand-maker Ollivander. Lucius Malfoy sends Wormtail to the cellar to check on the noise. Harry reminds Wormtail of his life debt. Wormtail hesitates and is then fatally strangled by his own silver hand (which forced Wormtail's allegiance to Voldemort or else kill him at the slightest sign of betrayal). Harry and Ron rescue Hermione; Ron disarms Bellatrix and Harry disarms Draco Malfoy, Alyssa Prewett dives for the wand to help her boyfriend when Hermione knocks her down, Harry takes Draco's hawthorn wand. Dobby reappears and disapparates with them, but he is struck by Bellatrix's and knife during the escape and dies.
Harry now has to decide whether to chase Horcruxes (battle Voldemort, and follow Dumbledore's orders) or Hallows (and battle death as he learns more about Dumbledore's past). He chooses to seek the Horcruxes and discusses breaking into Gringotts with Griphook. Ollivander confirms that the Elder Wand exists and will transfer its allegiance if its owner is defeated or disarmed. Aided by Griphook, Harry, Ron and Hermione penetrate Gringotts and retrieve Hufflepuff's Cup from the Lestrange Vault, although they lose the sword to Griphook in the process and are thus unable to destroy the Horcrux. Voldemort takes the Elder Wand from Dumbledore's tomb. Through his mental connection to Harry, he inadvertently reveals that a Horcrux is hidden at Hogwarts. Harry, Ron, and Hermione head to Hogsmeade to find a way in. After Death Eaters are alerted to the trio's presence, they seek refuge in the Hog's Head Inn. The bartender at the Inn turns out to be Aberforth Dumbledore. He tells Harry the story of his family, including his brother and Grindelwald's role in the accidental death of Ariana. Harry realizes that Dumbledore had been begging to die in his sister's place during the delirium while attempting to retrieve the locket Horcrux. Aberforth smuggles the trio into Hogwarts with the help of Neville Longbottom, who has assumed leadership of Dumbledore's army at Hogwarts, and other members of the Order and Dumbledore's army begin showing up. Luna suggests that the fifth Horcrux could be Ravenclaw's lost diadem. Hermione destroys the cup Horcrux with basilisk venom (procuring a fang from the Chamber of Secrets having Ron repeat what he heard Harry say years before to get in). Harry recalls seeing the diadem in the Room of Requirement when he hid his potions book the previous year. Harry, Ron, and Hermione enter but are ambushed there by Draco Malfoy, Alyssa Prewett, Crabbe and Goyle. Crabbe mishandles the powerful Fiendfyre spell, killing himself and destroying the diadem Horcrux. Harry saves Draco and Alyssa's life in their escape.
The Battle of Hogwarts commences between the Order of the Phoenix (including Piper Ashby and Vanessa Booth) and most of the Hogwarts faculty and student body on one side, and the Death Eaters, the Ministry of Magic, the Slytherins, and two giants on the other. Fred Weasley, Remus Lupin and Tonks are among the dead. Harry follows Voldemort to the Shrieking Shack, where Voldemort deliberately kills Snape, thinking it will make him the Elder Wand's master. Harry captures the dying Snape's last memories and takes them to Dumbledore's pensive. He learns that Snape had loved Harry's mother since they were children, and that the Silver Doe was Snape's Patronus as a result. Snape had turned double agent for Dumbledore to save Lily's life and had remained loyal even after her death. When he acquired the Resurrection Stone, Dumbledore was cursed by the Ring Horcrux, causing his dead hand, but Snape had saved his life by containing the curse. Dumbledore then ordered Snape to kill him if needed, in order to spare Draco and Alyssa. Snape's last memory is Dumbledore's conclusion that Harry himself is a Horcrux, which had created the connection between Harry and Voldemort. Harry realizes that he must die to finally render Voldemort mortal.
Harry asks Neville Longbottom to kill Nagini if he gets the chance and then heads for Voldemort's camp in the Forbidden Forest. On the way, Harry realizes that the clue on the Snitch says, "I am about to die." and he retrieves the Resurrection stone, which he uses to summon the spirits of his parents, Sirius, and Lupin to accompany him. Voldemort casts the "Avada Kedavra" curse at Harry, and Harry dies (along with his Horcrux). He awakens in an place that looks to him like King's Cross Station, unsure whether he is alive or dead. Dumbledore appears and congratulates Harry for choosing to destroy Horcruxes instead of chasing the Hallows which Dumbledore chose to try and revive Ariana. He explains that, just as Voldemort cannot die while his soul fragments remain alive, Voldemort cannot kill Harry because he used Harry's blood in his resurrection. Harry is then presented with the choice of easily passing on or return to the world of the living in order to continue to struggle against Voldemort.
Harry chooses to live but he fakes death. Voldemort orders Narcissa Malfoy (mother of Draco) to check on Harry. She realizes that Harry is alive and she asks hm about Draco's welfare, caring for her son and not either side's victory. Harry (barely whispering back) informs her that Draco is alive. Narcissa tells Voldemort that Harry is dead. Harry's still body is carried to Hogwarts by the weeping Hagrid as Voldemort's trophy. Voldemort resumes his assault on Hogwarts. When Neville defies Voldemort by refusing to join the Death Eaters and rallying the defenders, the Sorting Hat is summoned by Voldemort. He puts it on Neville's head and sets it on fire. Neville (with the help of his girlfriend Merope Prewett , who is Alyssa's cousin), breaks free of the binding curse placed on him, draws Gryffindor's sword out of the Sorting Hat and decapitates Nagini, destroying the final Horcrux. Harry quickly hides under his Invisibility Cloak as pandemonium breaks loose at the arrival for reinforcements for the defenders of Hogwarts. Help comes in the form of centaurs, Hogsmeade residents, and various family member of the fighters. The battle moves into the Castle, where the house elves join the fray, led by Kreacher.
In the Great Hall, the battles are pared down to Bellatrix fighting Ginny, Luna, and Hermione and Voldemort against Slughorn, McGonagall, and Shacklebolt. Bellatrix is eventually killed by Molly Weasley. Voldemort then uses the Elder Wand to blast his opponents off their feet. Harry then casts a shield charm to protect Mrs. Weasley, and takes off the Invisibility Cloak to confront Voldemort, informing him that Draco (not Snape) had become the Elder Wand's master by disarming Dumbledore. This allegiance was transferred to Harry when he won Draco's wand when him and Alyssa went for it. Therefore, Harry (not Voldemort) is the master of the Elder Wand. The two circle each other and Harry offers, despite all the strife and sorrow he has caused, Voldemort a final chance at redemption. Voldemort refuses, and they both become further prepared to act at a split moment's notice. Similar to their first duel, Harry casts Expelliarmus, while Voldemort casts the killing curse Avada Kedavra. The Elder Wand's allegiance prevents the spell from harming Harry, and the Killing Curse rebounds off Harry's disarming spell, thereby killing Voldemort.
After the climactic battle, Harry decides that the Elder Wand shall be returned to Dumbledore's tomb, Harry uses the power of the Elder Wand to repair his own wand before giving up the Hallows. By giving up the Hallows, Harry, the first person to have possessed all three (and therefore the first, and only, Master of Death), shows that he has come to terms with the notion of life ending for everyone, is not afraid of death, and demonstrates a strength beyond that of any other character in the series (including Dumbledore, Voldemort, and Snape).
Nineteen years later, Harry and Ginny Weasley are married with three children; Ron and Hermione are married and have two children; Draco Malfoy is married to Alyssa Prewett with one child. The families meet to send their children on the Hogwarts Express for the school year. The Lupins' son, Teddy, also is mentioned to be a part of the family and he seems to be having a romantic relationship with Bill Weasley and Fleur Delacour's daughter. It is shown that Harry has come to realization that both Dumbledore and Snape are heroes (having named one of his sons Albus Severus after the two). Neville Longbottom is married to Merope, and is the new Herbology teacher at Hogwarts. Neville has one daughter with Merope. George Weasley and Piper Ashby are married with twin sons. Gregory Goyle and Vanessa Booth are married with a daughter. The end of the story of Harry Potter, the boy who lived ends with these words "The scar had not pained Harry for nineteen years. All was well."
