The island of Berk is a Viking village that is plagued by attacks from dragons that steal its livestock. Hiccup, the awkward son of the village chieftain Stoick the Vast, is unable to wield the usual weapons to fight dragons, but has fashioned mechanical devices under his apprenticeship with Gobber the blacksmith to aid in defense. During one attack, Hiccup believes he has shot down a Night Fury, an extremely dangerous dragon that no one has ever seen, and later finds it in the nearby forest, trapped in a net. Hiccup tries to kill it, but finds himself unable to and instead cuts it free; the Night Fury roars and disappears into the forest.
Stoick assembles a fleet to seek out the dragons' nest, placing Hiccup into a dragon fighting class taught by Gobber along with other children of the village, including Astrid, a girl whom Hiccup has a crush on. After hearing that dragons will always go for the kill, Hiccup searches for and finds the dragon trapped in a shallow glade. He also realizes that the dragon's tail was injured, preventing it from flying normally. Hiccup earns the dragon's trust and begins to care for it. He names the Night Fury "Toothless", for its retractable teeth. Later, Hiccup fashions a makeshift harness and prosthetic tail that allows him to guide the dragon in free flight. Hiccup is able to transfer his knowledge of Toothless's behavior to the other species of dragons at dragon-fighting class, appearing to conquer each one in battle and becoming the star pupil, much to Astrid's dismay. Eventually Hiccup completes the class and gets the chance to kill a dragon in front of the entire village, much to his dismay. Meanwhile, the unsuccessful battered Viking fleet arrives home.
Astrid discovers Hiccup training with Toothless, but before she can tell the village, Hiccup takes her for a ride on Toothless. At first, Astrid is terrified, but then begins to enjoy the excursion. while Astrid expresses concern over Hiccup's upcoming exam, Toothless unexpectedly joins a flock of dragons and takes the pair straight into the dragon's nest, where they discover the presence of a gigantic dragon named the Red Death.[note 1] The Red Death depends on the food the other dragons bring back, or otherwise feed on the dragons themselves. After swiftly escaping the island, Astrid wants to tell the village of the nest, but Hiccup asks her to keep it a secret to protect Toothless.
Hiccup is put to his final exam the next day by fighting a Monstrous Nightmare, but when he tries to show the village the dragon's true nature, Stoick stops the fight, inadvertently angering the dragon and endangering Hiccup. Toothless hears Hiccup's scream and flies in to save him, but is captured himself. Hiccup, attempting to explain his actions, accidentally reveals how to find the dragons' nest. Realizing his mistake, he tries to warn his father of the danger, but Stoick refuses to listen to his son. Though shaken, Stoick demotes Hiccup from being a Viking, disowns him, and leaves with another fleet, using a restrained Toothless as their guide. After a heart-to-heart talk with Astrid, Hiccup then concocts a plan to save the Vikings with the help of the other children and the training dragons from their class.
Hiccup and his friends arrive to find the Red Death has burned the ships and is about to consume Stoick and Gobber. Hiccup's classmates distract it while Hiccup attempts to free Toothless. However, Hiccup and Toothless almost drown after the ship is destroyed by the distracted Red Death, but both are saved by Stoick. Hiccup and Toothless succeed in luring the Red Death into flight, ultimately damaging its wings and then forcing it into an inescapable dive back to earth, killing it in a massive explosion with its own prematurely ignited fire breath. While attempting to flee from the crashing dragon, Hiccup falls and Toothless dives into the flames after him. Stoick finds Toothless, who reveals an injured and unconscious Hiccup safely wrapped in his wings.
Hiccup wakes up back on Berk, discovering his leg has been amputated and replaced with a prosthesis made by Gobber. He is elated as he steps outside to find the Vikings and dragons working together to rebuild their village, and Astrid rushes to kiss him. The film ends with the war between Vikings and Dragons finally over with Hiccup and his friends racing their dragons.