Part 1 of the novel is presented as an excerpt from the journal of John H. Watson, an army doctor who has just returned to England after being injured during the Second Afghan War. Watson is living in a London hotel, “leading a comfortless, meaningless existence,” when he runs into an old colleague, Stamford. The two catch up, with Watson recounting to Stamford his misfortunes during the war and his need to find a less expensive residence. Stamford mentions that an acquaintance, Sherlock Holmes, is looking for a roommate, and after warning Watson about Holmes’ eccentricity and scientific coldness, agrees to introduce them.
After Holmes and Watson meet to discuss the rooms and review their compatibility with each other, they move immediately into 221B Baker Street, and find each other easy to live with. As he has little else to do, Watson becomes increasingly interested in his roommate’s eccentricities — such as his deep knowledge of chemistry and British law and simultaneous ignorance of literature and astronomy — and spends much of his time speculating about Holmes’ profession but failing to come to a conclusion. Holmes, however, eventually reveals that he is a “consulting detective” who helps other detectives with their cases by applying “the science of deduction and analysis.” Holmes claims that he is able to deduce the history and profession of any man through careful observation and analysis. Though Watson is skeptical, when a Scotland Yard messenger whom comes to their door confirms Holmes’ deduction that he was once a Marine sergeant, Watson is amazed.
The messenger delivers a letter from a Scotland Yard detective, Tobias Gregson, asking for assistance on a recent murder case. Though Holmes is initially reluctant to take the case because Gregson and his colleague Lestrade will likely take the credit for solving it, Watson convinces him to take the case, and Holmes invites Watson to the crime scene at an empty house on Brixton Road. Approaching the house, Watson watches Holmes examine the road and garden path outside the house before they meet Gregson and Lestrade inside, where the body of an American man, Enoch Drebber, lies on the ground. Though there are splashes of blood all over the floor, there is no wound on the body, and on the wall, written in blood, is the word “RACHE.”
Detectives Gregson and Lestrade are at a loss to explain the mystery, though Lestrade offers an incorrect theory that the murderer had tried to write “Rachel” but was disturbed before finishing. When the police move the body, they discover a small gold wedding ring. After Holmes thoroughly examines the room with his tape measure and magnifying glass, he soon disproves Lestrade’s theory, saying that “RACHE” means “revenge” in German and that it was intended to put the police off the murderer’s trail. Though Gregson and Lestrade are somewhat scornful of Holmes’ methods, they are astounded when Holmes gives them a detailed profile of the killer: the murderer was six feet tall, with small feet, square-toed boots, a florid face, and long fingernails on his right hand. He smoked a Trichonopoly cigar, arrived with the victim in a cab whose horse had three old shoes and one new shoe, and he poisoned the victim.
Having learned all he can from the crime scene, Holmes decides to interview the constable who found the body. When Holmes and Watson visit the constable, John Rance, at his home, they find him unwilling to talk until bribed by Holmes, who learns that Rance had encountered no one near the scene of the crime, except an exceptionally drunk man. Deducing that the drunk man was actually the murderer in disguise, Holmes scolds the officer for his incompetence. On their way back to Baker Street, Holmes explains to Watson that the murderer had lost the ring and went back to the crime scene to look for it. In order to draw out the murderer, Holmes decides to put out a newspaper advertisement claiming that Watson has the lost ring and is willing to return it to its owner. That very night, an old woman visits 221B, claiming that the ring belongs to her daughter. Watson gives the woman the ring, and she leaves. Believing her to be the murderer’s accomplice, Holmes follows her by secretly jumping onto the back of her cab. However, when the cab stops, the woman is nowhere to be found, leading Holmes to conclude that the old woman was actually a man in disguise.
The next day, Gregson visits Holmes and Watson at Baker Street and triumphantly informs them that he has arrested a man named Arthur Charpentier for Drebber’s murder. Drebber, he discovered, had been staying at the boarding house of Arthur’s mother and had attempted to abduct Arthur’s sister Alice. As Arthur had angrily chased Drebber into the street and had no alibi for the time of the murder, Gregson took him into custody. However, Lestrade soon arrives to announce that there has been another murder. Intending to question Joseph Stangerson, Drebber’s secretary, Lestrade found him stabbed to death in his hotel room with the word “RACHE” written on the wall. Though Lestrade did not find anything else about the room particularly important, Holmes realizes that the pillbox in Stangerson’s hotel room is the last clue. After obtaining the pillbox from Lestrade, Holmes tests the two pills on an old dog in the building. The first pill has no effect, but the second pill immediately kills the dog, leading Holmes to conclude that the pillbox contained one poisonous pill and one harmless pill.
Just then, Wiggins, one of the street urchins employed by Holmes, arrives to tell him that the cab Holmes wanted is here. Requesting the driver’s help with his luggage, Holmes summons the cab driver to the room. Catching the driver off guard, Holmes handcuffs him and introduces the driver to the others as Jefferson Hope, the murderer of Drebber and Stangerson.
In Part 2, the story flashes back nearly 40 years to the desert in western America. It is 1847, and a man named John Ferrier and a little girl named Lucy are on the brink of death. The last survivors among pioneers who had died of dehydration and starvation, Ferrier and Lucy were unable to find water and are lying down to die. They are found, however, by a host of Mormons led by Brigham Young heading to what they call the new “promised land.” Young offers them assistance only if they convert to Mormonism, and they agree, assimilating into the Mormon community in the newly built Salt Lake City. Ferrier adopts Lucy, raising her as his daughter, and she grows up to be a beautiful and strong young woman who falls in love with a Gentile (non-Mormon) hunter and silver prospector, Jefferson Hope.
Lucy and Hope become engaged and plan to get married after Hope returns from a two-month mining job in Nevada. Soon, rumor spends of their engagement, and Brigham Young visits John Ferrier to tell him that Lucy is forbidden from marrying a Gentile and that he has 30 days to force Lucy to marry either Enoch Drebber or Joseph Stangerson, sons of the Mormon elders. Ferrier, who views Mormon polygamous practices as shameful, never wanted his daughter to marry a Mormon, and sends out a message to Hope, asking for help. That day, he finds Stangerson and Drebber in his home, presumptuously arguing over who has the better claim to Lucy. Furious, Ferrier throws them out, and the men threaten retribution. The next day, Ferrier finds a note pinned to his blanket, warning that he has only 29 days left. The day after that, the number 28 mysteriously appears on the ceiling, and every day a new number appears around the house, counting down the days Lucy has left to make a decision between Drebber and Stangerson.
Two days before the Ferriers’ time runs out, Hope finally arrives, helping them to escape Salt Lake City in the middle of the night. When their supplies begin to dwindle, Hope leaves Ferrier and Lucy at the campsite to hunt for food, but when he returns he finds the campsite empty, save for a dying fire and a newly dug grave for Ferrier. When Hope returns to Salt Lake City, he learns that Stangerson had murdered Ferrier and that Lucy was forced to marry Drebber. Now that Hope has nothing else to live for, he decides to devote the rest of his life to revenge.
A month after her wedding, Lucy dies, presumably out of grief or a broken heart, but Drebber, who married her for her father’s property, is unconcerned. While Drebber’s other wives mourn Lucy, Hope breaks into Drebber’s house to kiss Lucy’s forehead and to take her wedding ring, exclaiming that he will not let her be buried in it. For months, Hope lives in the mountains outside Salt Lake City, prowling around town and making close but unsuccessful attempts to take Drebber’s and Stangerson’s lives. Though Hope is intent on revenge, his time in the mountains damages his health, forcing him to return to his old job in Nevada to regain his health and earn money. Years later, he returns to Utah to kills Drebber and Stangerson, only to discover that they have broken from the church and moved away. For years, Hope travels from town to town in America looking for the men, tracking them to Cleveland and then all over Europe, until he finally found them in London.
The narrative now returns to Watson’s account of Hope’s capture. After a brief moment of wild resistance, Hope calms down and agrees to go with the men to Scotland Yard. Because he suffers from an aortic aneurysm that could burst at any time, Hope decides to tell his story to the detectives. The men he killed, he argues, were murderers themselves and deserved to die. He recounts his history with Drebber and Stangerson and their responsibility for the deaths of Lucy and John Ferrier. After he tracked the men to London, he became a cab driver and after following Drebber and Stangerson around the city, finally caught one of the men, Drebber, alone. As Drebber was drunk, it was easy for Hope to lead him to the house on Brixton Street, where he forced Drebber to take a pill from pillbox and took the other himself, leaving it to God to decide who would die. (Throughout the time he his telling this story to the detectives, Hope’s aneurysm causes his nose to bleed, though he doesn’t realize it at the time.) After Drebber died, an elated Hope decided on a whim to write “RACHE” on the wall to lead the police down the wrong path, and left the house.
Later, he realized that Lucy’s ring was missing, so he returned to the crime scene but found Constable Rance already there and only narrowly avoided suspicion by pretending to be drunk. After seeing Holmes’ advertisement in the paper, he had a friend disguise himself to pick up the ring at Baker Street. Hope had intended to enact the same revenge on Stangerson, but as news of Drebber’s murder had already reached him, Stangerson was being even more cautious than usual. Hope, however, found a way into Stangerson’s hotel room and attempted to force him to choose a pill, just as he did to Drebber. But Stangerson ignored the pills and attacked him, leading Hope to stab him in self-defense. Concluding his statement, Hope insists that he was acting as “an officer of justice.”
Days later, Hope dies of his aneurysm before he was scheduled to appear in court. His body is found with a smile on his face, as if he is at peace. After withholding much information from Watson during the course of the investigations, Holmes now tells him everything, explaining how he had deduced Hope’s identity and how he used street urchins like Wiggins to find him. Watson commends his detective skills, and Holmes shows Watson an article that gave Lestrade and Gregson full credit for solving the case. Indignant on Holmes’ behalf, Watson decides to publish his account of the case to set the public straight.