He might have defeated the Dark Lord many times and came down in the Wizarding World as "the boy who lived," but Harry Potter is by no means the best student in Hogwarts' history. In the Harry Potter books and movies, many rival his skill, surpass his intelligence, and even compete with his feats. Some of them are even within the same batch or generation as Harry himself.
In that regard, many of them could theoretically defeat Potter, whether in a fair duel or even a life and death situation. Of course, they didn't actually defeat Potter, but their display of magical knowledge and achievements could easily give them an edge against Harry. Here are 10 of those Hogwarts students (both old and new) who could have defeated Harry in a fair fight.
10 DRACO MALFOY
Harry and Draco were pretty much neck-and-neck when it comes to dueling and wand-related stuff. It was only until Harry got a hold of Snape's diary and channeled his Slytherin tendencies that he was able to win against Malfoy. As a result, he nearly killed Malfoy in The Half-Blood Prince.
Without Snape's diary and Harry finding out that lethal spell, the fight between the two could have turned out differently. Moreover, Draco was still a little distracted about what he just did before that scene in The Half-Blood Prince. A closer representation of how their duel could have turned out more fairly was in The Chamber of Secrets. In any case, Draco is a capable duelist that could give Potter more nasty forehead scars.
9 LUNA LOVEGOOD
Luna Lovegood is one of the lesser-known prodigies in the Harry Potter books and films. She conjured and learned her first Patronus at the age of 14. Of course, Harry did learn the Patronus back at just 13, but to be fair, he had a better teacher and more hands-on training. Additionally, Lovegood has competed in duels at the age of 15.
Her participation at the battle of Hogwarts and easily held her own against Death Eaters. It's safe to assume that she could have been a match against Harry had they been the same age, Harry is older by only a year. Even so, Luna mostly prefers to be in peace rather than show her skills.
8 CEDRIC DIGGORY
Given Cedric Diggory's achievements, looks, and temperament, he could have easily been the prophesized boy and definitely gave Harry a run for his money. Cedric, by all means, is a model wizard, perhaps more so than Potter, and that's a tall order for someone who didn't have the advantage of being a "Chosen One."
Cedric is even more talented than Potter (though he was older) and easily held his own in the Triwizard Tournament. It's worth noting that Cedric easily took down a murderous Victor Krum in the final task of the Triwizard tournament. The Hufflepuff could have easily did the same to Potter if only the two had been enemies.
7 HERMIONE GRANGER
Both Harry and Ron could not have done half of what they did in the books and films successfully, if not for Hermione Granger. She notably does most of the "heavy lifting" when it comes to all of their adventures. Given Hermione's brilliance and genius, Harry would have been lost or dead without her.
The funny thing is, Hermione didn't even need a wand to defeat someone in a duel, as she demonstrated when she punched Malfoy square in the face. Moreover, her resourcefulness with magic (time-turner and spells) can easily put Harry at a disadvantage when it comes to a duel. For all we know, she probably knows more spells than Harry could counter.
6 BILL WEASLEY
We didn't get a chance to see Bill Weasley in a film until The Deathly Hallows, and by then, it was clear who the coolest Weasley was. Bill is tall, fair, and red-haired (which isn't to say he has no soul), making him one of the most unique among the Weasleys. Additionally, Bill's achievements in Hogwarts are enough to make even Hermione blush.
He earned 12 O.W.L.s during his fifth year and got named Head Boy at Hogwarts. As a testament to Bill Weasley's spell knowledge, he can remove curses on anyone and anything. Bill is also an accomplished master at Defense Against the Dark Arts, even surviving against Fenrir Greyback: one of Voldemort's elite Death Eaters.
5 NEWT SCAMANDER
Long before Albus Dumbledore groomed someone to take on another Dark Lord, there was Newt Scamander. He was sadly expelled from Hogwarts after an incident involving magical creatures, but Newt still went on to become a skilled wizard on his own.
It's worth noting that Newt has dueled against Gellert Grindlewald in Fantastic Beasts and Where to Find Them and survived. Grindlewald easily had the upper hand in that duel, but you have to remember that Newt wasn't even an Auror, nor did he have any help. Harry, on the other hand, has had plenty. Plus, Newt was a rather commendable master at apparating.
4 SEVERUS SNAPE
There's no doubt that Severus Snape is one of the most powerful wizards both in Voldemort's or Dumbledore's army. Playing as a double agent for both sides took cunning and skill usually reserved for the most talented wizards or witches. Snape didn't get to show that talent until after he graduated from Hogwarts, however.
Still, Snape managed to be secretly formidable during his school years. It was he who invented one of the most dangerous curse-spells in the Wizarding World, called Sectumsempra, something not many wizards or witches have done in their childhoods. Moreover, it was only Snape who knew how to counter and heal that spell. Harry never would have stood a chance against Snape if they were the same age.
3 MINERVA MCGONAGALL
Back in her youth, Minerva McGonagall was basically Hermione Granger. She always had the best grades in her generation and had top scores in the O.W.L.s and N.E.W.T.s. As such, her knowledge of spells and the Wizarding World is nearly peerless.
On top of that, she was also an Animagus and a master of transfiguration, even when she was the same age as Harry in his Hogwarts years. Oddly enough, it seems Hermione was her reincarnation as both of them got accepted to work in the Ministry of Magic due to their talent and knowledge in spells.
2 TOM RIDDLE
To date, Tom Riddle a.k.a. Voldemort was probably the most practically talented student in Hogwarts. By the time he graduated, he was already immortal. In fact, Tom created his first Horcrux in his fourth year at Hogwarts after killing Myrtle Waren, a.k.a. Moaning Myrtle.
Years after that, Riddle had already become even more immortal many times over and amassed more Horcruxes. It's not as if he needed them either. Riddle was already an unstoppable wizard, and only one other living wizard was able to stop him in a straight duel back in his heyday...
1 ALBUS DUMBLEDORE
Even with students like Tom Riddle coming and going in Hogwarts, the school still considers Albus Dumbledore as its crowning achievement and most brilliant student ever. After all, he taught and even mentored all of the other people on this list.
Back in his youth, Dumbledore was made both Head Boy and Prefect of Hogwarts and his respective house (Gryffindor). As a student, Dumbledore also befriended people in high places like Nicholas Flamel. One of his teachers even claimed that she saw Dumbledore do things with a wand she had never seen before... magical things-- spells, okay? It's safe to say that Harry holds no candle to Dumbledore as a Hogwarts student. Thankfully, he never had to duel him.