Chapter 1 opens as the wizard Gandalf visits the hobbit Bilbo Baggins and invites him to join in an adventure. Bilbo declines, reluctant to leave the safety and comfort of his hobbit-hole. The next day, he is visited by dwarves who believe Bilbo can be of use to them in their journey to the Lonely Mountain to reclaim their ancestral treasure, now in the possession of Smaug the dragon. Bilbo realizes that Gandalf had represented him to the dwarves as a burglar. He reluctantly agrees to go, but he changes his mind the next morning. Gandalf urges him to join them, however, and they depart — a band of fourteen.
Chapters 2 through 10 depict Bilbo, Gandalf, and the dwarves traveling out of the hobbit-lands toward the Lonely Mountain far to the east. As the landscape becomes less hospitable and the group faces hunger, bad weather, and attacks from hostile creatures, Bilbo often thinks fondly of home and questions his decision to come on this journey. In the Lone-lands, the travelers encounter trolls who capture the dwarves and tie them up in sacks, planning to roast and eat them later. They are rescued by Gandalf and Bilbo, who produces a key he found nearby. The key unlocks the trolls' secret cave, where the travelers find gold and weapons, to which they help themselves. They travel on to the valley of Rivendell at the edge of the Wild, and stay at the home of Elrond, a hospitable elf leader. Elrond translates the runes on the swords that Gandalf and Thorin Oakenshield, king of the dwarves, took from the trolls' cave; they are ancient swords called Orcrist and Glamdring that come from dragon plunder or the Goblin-wars. Elrond also translates Thorin's map, which clarifies the importance of Durin's Day, the first day of the dwarves' New Year.. After two weeks, Bilbo, Gandalf, and the dwarves resume their journey. Approaching the Misty Mountains, they take shelter from a storm in a cave that turns out to be the Great Goblin's cavern. The Goblins capture Bilbo and his companions and take their ponies. Using Glamdring, Gandalf kills the Great Goblin and frees Bilbo and the dwarves. The travelers try to find their way out of the cave as the Goblins retreat, but Bilbo falls on his way out and loses consciousness.
When Bilbo regains consciousness and tries to make his way out of the cave, he finds a ring that he absentmindedly pockets. This incident, in Chapter 5, marks a dramatic moment in his adventures, for the ring confers powers of invisibility on whomever wears it. Bilbo encounters old Gollum, a slimy, murderous creature who kills and eats Goblins and others who stray into the cave. They exchange riddles, and Gollum discovers that Bilbo has the ring, which is Gollum's favorite possession. At the same time, Bilbo puts on the ring and discovers its magical power. Pursuing the invisible Bilbo, Gollum inadvertently shows him the way out of the cave. Bilbo has the opportunity to kill Gollum, but decides his invisibility is an unfair advantage and, instead, leaps over his head through the mouth of the cave.
After he is outside, Bilbo plans to go back and rescue his friends but finds they have escaped, too. He tells his tale and gains their respect. Then they all run away from the Mountains, fearful of the Goblins. They are chased up into trees by Wargs, menacing wild wolves. Gandalf chases the Wargs away, but the Wargs soon return with Goblins and try to smoke Bilbo and the dwarves out of the trees by setting fire to the forest. Bilbo and the dwarves are rescued by eagles, who fly them to their nest. After spending the night in safety, they resume their travels east and Gandalf takes them to the house of Beorn, the skin-changer, who outfits them for the next leg of their journey, through the forest of Mirkwood. At the end of Chapter 7, Gandalf leaves them at the edge of Mirkwood, warning them not to stray from the path. Gandalf does not reappear until the Battle of Five Armies near the end of the book.
Bilbo and the dwarves travel through the forest and use a boat to cross an enchanted lake. They rescue Bombur, one of the thirteen dwarves, from a fall into the lake. Hungry, they approach a party of feasting elves, but to no avail. Bilbo is captured by a spider, but fights his way free with the sword he took from the trolls; he names it Sting. Wearing the ring of invisibility, he frees the dwarves who have been bound in spiders' webs and reveals to them the secret of the ring. At the end of Chapter 8, Bilbo and the dwarves find that Thorin has been captured by elves, and in Chapter 9, all the dwarves are captured and thrown into the dungeon under the palace of the Elvenking. Bilbo escapes this fate because he is wearing the ring that makes him invisible, and he wanders around the Elvenking's palace until he has developed a plan to free the dwarves. He hides them in empty wine barrels that are dropped through the floor of the palace and float down the river to Esgaroth or Lake-town. Bilbo and the dwarves spend some time in Lake-town, a town of men, but then move on and disembark near the Lonely Mountain.
Chapter 11 depicts the encounter with Smaug the dragon, the object of the journey. The travelers can see the door to Smaug's lair in the side of the Lonely Mountain, but they can't open it until Bilbo suddenly understands the clues in Thorin's map. On Durin's Day, using the key from Thorin's grandfather, Bilbo enters the Lonely Mountain. He sees Smaug the dragon sitting on the treasure hoard and, despite great fear, engages him in conversation and emerges with a cup he has stolen from the hoard. At this point, Bilbo becomes, in effect, the leader of the group. He re-enters Smaug's lair and steals the Arkenstone, the precious gem of the hoard. In a vengeful rage, Smaug comes out of his lair and destroys the town of Esgaroth. Bard, a Lake-town archer, kills Smaug.
At this point, in Chapter 14, various groups begin to converge on the Lonely Mountain, because the treasure Smaug had guarded is now up for grabs. Thorin refuses to ally with Bard or the elves, and Bilbo gives Bard the Arkenstone to use in bargaining with Thorin. Gandalf reappears. The Battle of Five Armies ensues — dwarves, men, and elves fighting against Goblins and Wargs. After the battle, Bilbo is taken to see Thorin, who is dying. He is buried with Orcrist and the Arkenstone; his inheritance, the hoard, is divided. Bilbo leaves with Gandalf, Elvenking, and Beorn to go back to the hobbit-lands. They stay with Beorn over Yule-tide and return to Elrond in the spring. When Bilbo arrives home, he finds that his house and its contents are being auctioned, because he is presumed dead. He recovers most of his possessions and leads an eccentric life, sometimes visited by his travel companions.