The day of the twins' trial arrives. Pudd'nhead Wilson, who is their attorney, and Aunt Patsy, their landlady, are their only allies, although even Pudd'nhead is starting to doubt their innocence. Everyone is present at the trial, including Roxy, who carries her bill of sale with her, and "Tom", who has angered Roxy by suggesting that the twins did them a favor by killing Judge Driscoll (Roxy has no reason to think "Tom" has been involved). "Tom" has been giving Roxy a substantial stipend. Pembroke Howard is prosecuting the case. He establishes a motive for the crime--the lost election and the refused challenge to a duel--and reminds the court that the judge had said in public that the twins would be able to find their knife the next time they needed to assassinate someone. Things are looking bad for the twins. Pudd'nhead calls three witnesses: the women who saw "Tom" disguised as a woman leaving the judge's house. He tells the court that their story suggests that another party is involved, who must be found in order for the twins to get a fair trial.
The court adjourns for the day, and "Tom" leaves congratulating himself on his clever disguise and his care in destroying all the evidence. Pudd'nhead returns home and once more looks over all the fingerprints in his collection from females. "Tom" stops by to mock him, and handles a few of the slides with the prints on them, including an old one from Roxy. He notes that he and "Chambers" were only seven months old when that set was taken, and then asks Pudd'nhead a question about a line on Roxy's prints. Pudd'nhead holds up the prints to the light, and is suddenly startled by something he sees. "Tom" asks him what has affected him, and Pudd'nhead assures him he is just tired. After "Tom" leaves, Pudd'nhead pulls "Tom"'s old prints from his collection. The print that "Tom" had left on the slide with Roxy's prints matches the prints on the knife perfectly, as do more recent sets of "Tom"'s prints. Pudd'nhead also looks at "Tom"'s prints from his infancy and is startled to see that they don't match the others. Confused, he goes to sleep. A dream suggests a reason for the discrepancy to him, and he rushes to check more of his collection. Pudd'nhead has apparently figured out Roxy's secret.
Pudd'nhead prepares a series of displays for the court. The next morning he arrives at the trial and informs the judge that he has new evidence. Proceeding dramatically and incorporating a few careful guesses, Pudd'nhead lays out his case for the twins' innocence, explaining the theory behind fingerprinting to the audience, who had laughed upon seeing him produce his slides. He gives a brief demonstration of the process, identifying a series of prints that members of the audience have provided. The twins are released from suspicion, but Pudd'nhead delays naming the murderer. Instead, he produces evidence of Roxy's baby switch. Finally he names "Tom" as not only the murderer but as in reality a black slave named Chambers. "Tom", or Chambers, faints, and is arrested. Roxy begs God for mercy.
The town immediately revises its opinion of Pudd'nhead and the twins. The twins, tired of their notoriety, depart for Europe. "Chambers", now known as Tom, becomes a free man and the heir to the judge's estate. Having been raised as a slave, and speaking in a black dialect, he can't bring himself to inhabit "the white man's parlor." The slave quarters are no longer an option for him either, and he spends his time alone and unhappy. Tom continues Roxy's stipend. She is now a meek creature who spends most of her time in church seeking to redeem herself. Chambers, formerly known as "Tom," confesses to the crime and is sentenced to life imprisonment. The creditors who had been only partially compensated at Percy Driscoll's (Tom's father) death reappear, however, claiming that Chambers, in reality a slave, should have been sold years ago to pay them. By a convoluted logic, they claim that, had he been sold, the judge would not have been murdered, and therefore it is not Chambers, but the mistake surrounding his identity, which is responsible for the murder. The governor of Missouri agrees and pardons Chambers/"Tom," who is then immediately sold "down the river."
Pudd'nhead's science triumphs and objective truth seems to save the day. The resolution of the trial, though, leaves both Tom/"Chambers" and Chambers/"Tom" in ambiguous positions. By revealing "Tom"'s true identity along with his guilt, Pudd'nhead actually saves his life: as a slave, he is a valuable piece of property. However, it is left open whether being sold "down the river" is a better fate than life in prison or even execution. As for the real Tom, his is perhaps the most horrible situation of all. Taught to think of himself as less than a man, he cannot speak the way a white man should and he finds himself in a terrible limbo. The town has thought of him as a black man for so long that it is impossible for him to move into white society, yet their view of what is proper for a white man keeps him from his friends in the slave quarters. Twain refuses to tell of Tom's fate, saying only that it would be "curious" and "a long story." Reconstruction (the attempt to reintegrate the South after the Civil War and the effort to give blacks a more secure place in society) had begun to fail noticeably by the time Twain was writing this novel; perhaps the real Tom's fate can best be read as an allegorical representation of the situation of blacks in America in the 1890s. It is fascinating that Tom/"Chambers" is most trapped by his speech, his most direct form of self-representation. Chambers/"Tom" has passed as a white man for so many years on the basis of his "proper" speech (although he fails at Yale), and the twins have made a living on their ability to spin a yarn about themselves.
Twain himself built an entire alternate persona based on different types of public speech--speaking tours, witty sayings, newspaper articles. This abstract, subjective form of declaring one's identity is a challenge to Pudd'nhead's seemingly objective scientific approach, but in its way it provides a pessimistic confirmation of Pudd'nhead's role model Benjamin Franklin's theory that men create their own places in the world.