The narrative opens in the antebellum Missouri town of Dawson’s Landing, introducing David Wilson, a young college-bred lawyer who earns the permanent, dismissive nickname Pudd'nhead after a tactless remark about a barking dog. Meanwhile, Percy Driscoll and his slave Roxana each have a baby boy born on the same day. Fearing her child will eventually be sold down the river into harsher plantation slavery, Roxana swaps the infants in their cradles. The light-skinned slave infant grows up as the white heir Thomas à Becket Driscoll, while the true heir, Chambers, is raised in servitude.
As the boys grow, the false Tom develops into a vicious, spoiled, and indolent youth, burdened by heavy gambling debts that lead him to steal from his neighbors during a series of mysterious village raids. Chambers remains docile, fiercely protective of his master, and accustomed to abuse. Judge York Leicester Driscoll, Percy's wealthy and proud brother, continually supports and protects Tom, though he repeatedly rewrites his will in frustration over the young man's dissolute behavior. When two aristocratic Italian twins, Luigi and Angelo Capello, arrive in the village, they captivate the local society but soon spark local political rivalries and a bitter feud with the Judge.
Pressed by mounting debts and creditors, Tom resolves to rob his uncle. During a nocturnal burglary, he is caught by Judge Driscoll and murders him with an exotic Indian knife stolen earlier from the twins. Luigi is immediately accused and put on trial for the murder, facing certain execution amidst intense public hostility. Pudd’nhead Wilson steps forward as the defense counsel, utilizing his long-ignored hobby of collecting fingerprints to dismantle the prosecution's case.
Wilson proves through natal autographs that the bloody fingerprints on the murder weapon belong neither to the twins nor to any local resident, but rather to the false heir, Tom Driscoll. During the trial's climax, Wilson reveals the cradle-swap executed by Roxana decades prior, exposing Tom's true identity as a black slave. The community reels from the revelation, the twins are exonerated, and Tom is unmasked as the murderer.
Stripped of his inheritance and his freedom, Tom faces the consequences of his actions. Because he was technically a slave at the time of the crime, creditors claim ownership of him, and he is ultimately sold down the river. Roxana's lifelong sacrifice ends in profound sorrow, while Wilson finally sheds his derisive nickname and achieves the professional recognition he long deserved.