On the island of Berk, which is beset by dragons that raid their stock of sheep, the Viking chief Stoick the Vast's son Hiccup (who is the wimpiest and smallest teen on the island of Berk) works as an apprentice to the blacksmith. Hiccup explains to the viewer he is a small Viking, and doesn't have the strength or skill that his fellow Vikings have and is somewhat overlooked and not taken very seriously amongst his tribe. He also explains that his tribe celebrates strong dragon slayers, and he desperately seeks to become one. His father does not wish for his son to be hurt, especially because he doesn't have the strength to survive, and generally avoids having him included in the more violent aspects of the tribe.
During a raid, Hiccup shoots down a rare and greatly feared dragon called a Night Fury with a bolas cannon that he made, but no one believes him. Attempting to get proof, Hiccup goes to the woods and finds the downed dragon. He threatens to kill the dragon (saying he will cut out the dragon's heart and take it to his father), but cannot bring himself to do such a task. Instead, he frees it, and it aggressively sizes him up before flying off to a canyon.
Stoick enrolls Hiccup in dragon training with the other village youths and leaves with a search party of Vikings to find the Dragon’s Nest, in order to wipe them out and finish the war. After being told that dragons are vicious and will always "go for the kill," Hiccup returns to the forest, wondering why the Night Fury didn't. The Night Fury is still trapped in the canyon, and is missing a part of its tail from the previous crash landing, leaving it unable to fly properly. Hiccup decides to befriend the dragon, which he names Toothless, and eventually fashions an artificial tail fin and control harness. While helping Toothless fly again, Hiccup gains an extensive appreciation of dragons. With this knowledge, Hiccup is able to progress in dragon combat training to the amazement of his classmates and the jealousy of Astrid, who becomes strongly suspicious. He is given a book by Gobber that contains much knowledge of the different species of dragon that assail the village, and he quickly finds through his own interactions with the dragons that the information within the book is wrong.
Stoick and his army return battered and tired, without having found the nest. However, Stoick's spirits are lifted when Gobber and others begin congratulating him on Hiccup's rise as a formidable warrior. Feeling a chance to bond with his son, Stoick honors Hiccup with a Viking helmet made from half of the breast plate of Hiccup's late mother.
When Hiccup earns the right to kill a dragon as a graduation rite, he decides to leave Berk with Toothless to avoid performing such an act. Astrid follows him to the hideout and discovers his friendship with the dragon. She tries to run back to the village, but Hiccup and Toothless stop her by picking her up and flying her to the top of a nearby tree; where she is stuck. Hiccup asks for a chance to explain, and they take her for a ride. In their flight, they get caught in a herd of dragons carrying food and follow them to their nest. There, they discover that the dragons steal food to feed a much larger, parasitic dragon (aka the Green Death, called the Red Death in the film) that eats them if they do not provide enough food. After they leave, Astrid wants to tell the village of the nest's location, but Hiccup decides against it in order to protect Toothless. Astrid agrees to keep quiet for the night.
The next day, during Hiccup's graduation, he throws down his weapons and tries to show everyone that dragons are not as bad as they seem. Stoick shouts to stop the battle before Hiccup can continue, and the agitated dragon, a Monstrous Nightmare, attacks Hiccup. Toothless hears Hiccup's screams and rushes to save him. He quickly overpowers the Monstrous Nightmare, the Vikings sent to capture him, and finally Stoick. He opens his mouth to kill the tribe leader, but at the last second Hiccup screams "No!" Toothless backs off and becomes tame and docile, and is quickly pinned by Vikings. Stoick confronts Hiccup angrily at learning about his son's friendship with a dragon. Hiccup accidentally tells him that he has been to the nest, and Stoick decides to use Toothless to lead them there, ignoring his son's desperate warnings about the nest's true danger, and disowning him in the process.
The Vikings set sail with Toothless, leaving Hiccup with Astrid. He notes that this situation would not have happened if he had killed Toothless in the first place, but he also discovers that he was merciful towards Toothless because of compassion, not weakness. Invigorated, Hiccup decides to use the dragons the Vikings use for dragon fighting practice to fly to the nest to help his tribe. Astrid gathers fellow classmates Tuffnut, Ruffnut, Fishlegs and Snotlout to help, and all mount the training dragons and set off after the Vikings.
As the Vikings arrive at the nest, all the dragons flee the island in the resulting attack and the roused giant Red Death sets all the boats on fire, including the one to which Toothless is chained. Hiccup and the others arrive, and, while he goes to free Toothless, the others try to distract the Red Death. As the boat is sinking, Hiccup tries to free the still-chained Toothless but nearly drowns. Stoick saves both his son and Toothless. Before Hiccup flies off on Toothless to fight the Red Death, Stoick apologizes and states that he is proud to call Hiccup his son.
During the aerial battle, the Red Death and Toothless face off,with Toothless mounting an ariel assault on the larger, slower dragon. The Red Death burns away Toothless' prosthetic wing, but Hiccup urges Toothless to set the Red Death's insides on fire. The Red Death then crashes to the ground, causing an explosion. Hiccup is knocked out and falls into the explosion, and Toothless dives in to save him. Stoick searches the rubble for his son, but only finds Toothless; at first, everyone thinks Hiccup has died in the explosion, but Toothless reveals that he saved Hiccup by wrapping him in his wings.
Hiccup reawakens in his home some days later, to find Toothless by his bedside. As he is getting out of bed, he realizes that his left foot was lost in the explosion and has been replaced with a prosthetic made by Gobber, parallel to the artificial tail fin created by Hiccup for Toothless; outside, he sees that the Vikings have invited the dragons to live in the village. Hiccup is welcomed back as a hero and receives a passionate kiss from Astrid. Gobber gives Hiccup a new prosthetic tail fin for Toothless, so then Hiccup and Astrid fly on their dragons through the newly-reformed Berk, signifying a new beginning for both worlds.