The fantasy novel The Hobbit by J. R. R. Tolkien takes place in an imaginary land called Middle Earth. It concerns the adventures of a hobbit named Bilbo Baggins as he joins 13 dwarves and a wizard named Gandalf to reclaim the ancient homeland and treasure of the dwarves in the Lonely Mountain, which has been appropriated by a dragon called Smaug.
As the story begins, Bilbo is accosted by Gandalf, who invites the hobbit to join an adventure. Bilbo adamantly refuses. However, the next day he is visited by Gandalf along with 13 dwarves, whose leader is Thorin Oakenshield. After they feast on Bilbo's food, they tell of their lost home under the Lonely Mountain. Gandalf has a map that marks a secret entrance, and the dwarves want to employ Bilbo as a burglar to help them get into the mountain and win back their wealth.
At first Bilbo balks, and the dwarves leave without him. He then changes his mind, runs after them, mounts a pony, and joins their quest. As they travel through wild countryside, they come across three trolls and are captured by them. Gandalf tricks the trolls into staying out past dawn and they turn into stone. They bury the trolls' gold and then head for Rivendell. In Rivendell, Elrond the elf helps to interpret the map and tells them how to find the secret passage into the mountain.
After they leave Rivendell, the travelers are captured by goblins in the Misty Mountains but manage to escape from the goblin tunnels. When he is separated from the others, Bilbo comes across a strange creature named Gollum with whom he plays a riddle game. Bilbo finds a gold ring that makes the wearer invisible. This used to belong to Gollum. It helps Bilbo escape from the caves and rejoin the others.
On the other side of the mountains, the travelers are pursued by wolves called wargs. The travelers hide in trees and the goblins set fire to the forest, but eagles rescue them. Next they stay with Beorn, a shape-shifter who can become a bear.
Without Gandalf, who has other business, the dwarves and Bilbo enter the forest of Mirkwood. The dwarves are captured by giant spiders, and Bilbo rescues them. Thorin and the dwarves are then captured by wood-elves, and Bilbo has to use his magic ring to free them. They hide in barrels and float down the river to Lake-town. The townspeople eventually welcome the dwarves and help them with provisions.
The dwarves and Bilbo climb the side of the mountain, find the keyhole, and open the secret door. Bilbo finds Smaug and the treasure, but Smaug awakens, and all the dwarves have to take shelter in the passage under the mountain. The angry dragon heads for Lake-town, where he is killed by Bard the archer. In the meantime, the dwarves take possession of the Lonely Mountain and its treasure.
As hostilities loom between the dwarves, the wood-elves, and the men in Lake-town, Bilbo steals the Arkenstone, the most precious of the mountain's treasures, and gives it to Bard. At this point Gandalf returns.
The Battle of Five Armies takes place between goblins, wargs, dwarves, elves, and men. Bilbo is knocked out and misses most of the battle. When Bilbo wakens, he finds that the goblins have been defeated and the others have reached agreements about the division of the treasure. He takes a portion and starts home accompanied by Gandalf and others.
When Bilbo returns home to the Shire, he finds out that since he has been presumed dead, his house and all his possessions are being auctioned. He gets them back and settles into his former life, but vividly remembers his adventures.