The setting of this story is described by young Jim Hawkins as the book begins: "Squire Trelawney, Dr. Livesey, and the rest of these gentlemen having asked me to write down the whole particulars about Treasure Island, from the beginning to the end, keeping nothing back but the bearings of the island, and that only because there is treasure not yet lifted, I take up my pen in the year of grace 17and go back to the time when my father kept the Admiral Benbow inn and the brown old seaman with the sabre cut first took up lodging under our roof." Gravely ill, Billy Bones resides at the Admiral Benbow for "many months." The brown old seaman' strikes fear into patrons' hearts as he consumes dangerous quantities of rum and sings an old sea song: "Fifteen men on the dead man's chest - Yo-ho-ho, and a bottle of rum! Drink and the devil had done for the rest - Yo-ho-ho and a bottle of rum." Bones warns Jim to keep his weather-eye open for a seafaring man with one leg' and relates tales of piracy and other foul deeds while he was pirate.
One evening, while he is guzzling rum, he is reprimanded by Dr. Livesey, who has arrived to examine Jim's dying father. A short time later, Black Dog, a mysterious "tallowy creature," frightens Jim into revealing the whereabouts of Bones. Following a brief sword duel with the "Dog," Blind Pew visits the old seaman, another of his old shipmates, who delivers the "black spot," a death summons used by pirates. Soon after, Bones succumbs to a stroke and Jim and his mother run to a nearby village, where the inhabitants refuse to help them. Just before the pirates reach the inn, Jim removes a key from the corpse and grabs an oilskin packet from the captain's old sea chest. While the pirates frantically sack Bones' belongings in the inn, Jim and his mother hide under a nearby bridge. Unable to find "Flint's fist,' the pirates escape, leaving Pew behind to be fatally trampled by horsemen from the village, who have finally decided to come to Jim and his mother's aid.
At the home of Squire Trelawney, Jim delivers the packet to Dr. Livesey. "This is the black-hearted hound's account book," the squire observes after the oilskin is removed. Passing over figures and course headings, the men turn to a second enclosure, a map of Captain John Flint's treasure island. Trelaweny experiences an uncontrollable fit of excitement, vows to secure the best ship in England, and commands Livesey and Jim to accompany him on a treasure-hunting voyage. Several weeks later, Trelawney hires Long John silver, a one-legged seaman and cook, and a salty band of other sailors. At Bristol, the crew weighs anchor and the Hispanolia begins its journey. Becoming acquainted with the charismatic sea cook, who totes a pet parrot named "Captain Flint," Jim is surprised when, hiding in an apple barrel on deck, he overhears Silver conspiring with crewmates Israel Hands and the young Dick to take the ship once the treasure is aboard.
After land is sighted, a battle ensues between Captain Smollett's royal forces and Silver's swarthy pirates. Jim escapes ashore and falls in with Ben Gunn, an unfortunate seaman who was marooned by Captain Flint three years earlier. Treading the boundary between the opposing camps, Jim wins the confidence of Gunn (who leads Dr. Livesy to the treasure, which the marooned sailor has transferred to his secret cave) and recaptures the Hispaniola after cutting her hawser and sending Israel Hands to his death at the bottom of the sea. Following a near-fatal experience with the surviving pirates (who arrogantly tip their leader the black spot and then rescind it once they realize that he has the treasure map), Jim accompanies Silver on the treasure hunt. When the angry rogues discover that the treasure has been removed, Silver Shoots George Merry (the rebellious rascal who had deposed him the previous evening). Firing musket balls form the surrounding trees, Dr. Livesey, Squire Trelawney, and Ben Gunn force the remaining freebooters into the interior of the island.
Trelawney and his crew stow the treasure safely in the Hispanolia's hold and leave provisions for the marooned pirates before setting sail for England. During a brief stop at a South American port, Silver, who faces trial and execution, steals a sack of coins and escapes over the rail. Jim Hawkins concludes: "Of Silver we have heard no more. That formidable seafaring man with one leg has at last gone clean out of my life; but I dare say he met his old Negress, and perhaps still lives in comfort with her and Capitan Flint. It is to be hoped so, I suppose, for his chances of comfort in another world are very small. The bar silver and the arms still lie, for all that I know, where Flint buried them; and certainly they shall lie there for me. Oxen and wain-ropes would not bring me back again to that accursed island; and the worst dreams that I ever have are when I hear the surf booming about its coasts or start upright in bed with the sharp voice of Captain Flint still ringing in my ears, "Pieces of eight! Pieces of eight!"