The book is set in the fictional village of King's Abbott in England. It is narrated by Dr. James Sheppard, who becomes Poirot's assistant (a role filled by Captain Hastings in several other Poirot novels). The story begins with the death of Mrs. Ferrars, a wealthy widow who is rumoured to have murdered her husband. Her death is initially believed to be an accident until a distraught Roger Ackroyd, a widower who had been expected to marry Mrs. Ferrars, invites Sheppard over to his house, Fernly Park for dinner, having something urgent to tell him.
Sheppard dines with Ackroyd; Ackroyd's neurotic, hypochondriac sister-in-law Mrs. Cecil Ackroyd; her young daughter Flora, engaged to be married to Ackroyd's stepson Ralph Paton; Major Blunt, a big-game hunter; and Geoffrey Raymond, Ackroyd's personal secretary. After dinner, Sheppard is brought into Ackroyd's study, where Ackroyd tells him that Mrs. Ferrars had confided in Ackroyd that she was being blackmailed by someone about killing her husband. Moments later, in Sheppard's presence, Ackroyd receives a letter that Mrs. Ferrars had posted, but he decides to finish reading it later, once Sheppard leaves.
On the walk home, Sheppard bumps into a stranger outside the gates. After returning to his home, where he lives with his gossipy spinster sister, Caroline, Dr. Sheppard receives a telephone call just before going to bed. He soon rushes out, telling Caroline that Parker, Ackroyd's butler, had just informed him of having found Roger Ackroyd murdered. Upon Sheppard's arrival, however, Parker claims to have never made such a call, but he, Sheppard, Raymond, and Blunt find that Ackroyd has indeed been stabbed to death.
Hercule Poirot, who happens to be cultivating vegetable marrows next door to the Sheppards, comes out of retirement at the request of Flora Ackroyd to investigate the murder, since Ralph Paton, who stands to inherit most of his stepfather's fortune, is the primary suspect but is nowhere to be found. Paton's footprints are found on the ledge of the window that Ackroyd had previously asked Sheppard to bolt. Raymond and Blunt both report having overheard Ackroyd speaking to someone from within his study, and Flora's testimony of having spoken to her stepfather before leaving for bed place Ackroyd's death into a narrow time frame for which Parker, Raymond, Blunt, Mrs. Ackroyd, and Miss Russell, the housekeeper, all have alibis. The telephone call placed to Dr. Sheppard is traced to King's Abbott station.
While the police are convinced that Ralph is the killer, Poirot is uncertain, focusing his investigation on several small details, such as the representative of a dictaphone company who had visited Ackroyd some days previously, the exact time at which Dr. Sheppard met the stranger at the Fernly Park gates, and the repositioning of a chair in Ackroyd's study. Poirot also finds a goose quill and a scrap of starched cambric in the summer house, as well as a ring with the inscription "From R." in the backyard pool. Poirot additionally notices that Ursula Bourne, a parlourmaid who had resigned earlier in the afternoon, had no alibi for the murder.
Poirot brings together five people related to the case -- Sheppard, Flora, Mrs. Ackroyd, Raymond, and Blunt -- and states that all of them have been concealing something from him. Dr. Sheppard aids Poirot in finding out what these secrets may be, as well as in conducting research into Ursula Bourne. Raymond and Mrs. Ackroyd both soon reveal that they were in debt, which Ackroyd's death would have resolved, for both were included in Ackroyd's will. Flora eventually confesses to stealing money from Ackroyd's bureau, having told Parker she was there to bid her uncle goodnight to hide her true intentions. In reality, she never entered her uncle's room, so in fact it had apparently been Raymond and Blunt who were the last to hear Ackroyd alive. This leaves Flora, Blunt, Raymond, and Mrs. Ackroyd without alibis. Blunt's secret is also revealed -- he is in love with Flora, and soon they announce their engagement.
More issues are resolved -- the goose quill was a heroin holder belonging to the stranger Sheppard met, who is actually Miss Russell's son; the ring belongs to Ursula Bourne, who had secretly married Ralph Paton. Dr. Sheppard, unbeknownst to the reader, had been helping Ralph hide the entire time. Peculiarly, although Poirot claims to know the killer's identity, he does not reveal it to the assembled group, as is his usual custom, before he dismisses them; he instead issues a warning directed at the killer.
The ending and the identity of the murderer
The book ends with an unprecedented plot twist. Once all of the others have left and Poirot and Sheppard are left alone together, Poirot explains how Sheppard had made use of a dictaphone Ackroyd had lent him in order to fool Raymond and Blunt into thinking that Ackroyd was still alive after Sheppard had left when in fact Sheppard, who has not only been Poirot's assistant, but also the story's narrator, had stabbed Ackroyd just before leaving the house. Poirot had noticed the inconsistency in the time it took for Sheppard to reach the gates, deducing that he must have looped back to Ackroyd's study window, which he had actually left unbolted, and planted Paton's footprints there. Earlier that day, he had instructed a patient of his to phone him from King Abbott's station at a specific time so that he could be on the scene when Ackroyd's body was discovered, in order to have a chance to remove the dictaphone and return the chair that had been concealing it from view to its original place. Sheppard was Mrs. Ferrars' blackmailer, and he murdered Ackroyd to stop him learning the truth from Mrs. Ferrars. Poirot gives Sheppard two choices: either he surrenders to the police, or, for the sake of his reputation and of his proud sister, he commits suicide.
In the final chapter, Dr. Sheppard admits his guilt, noting certain literary techniques he had used to conceal his guilt without having written anything untrue (e.g., writing "I did what little had to be done" at the point where he actually hid the dictaphone and moved the chair). He reveals that he had hoped to be the one to write the account of Poirot's great failure -- that is, not solving the murder of Roger Ackroyd. Thus, the last chapter acts as both Sheppard's confession and his suicide note.