Hadleyburg enjoys the reputation of being an "incorruptible" town known for its responsible, honest people that are trained to avoid temptation. However, at some point the people of Hadleyburg manage to offend a passing stranger, and he vows to get his revenge by corrupting the town.
The stranger's plan centers around a sack of gold (worth around $40,000) he drops off in Hadleyburg at the house of Mr. and Mrs. Richards, to be given to a man in the town who purportedly gave him some life-changing advice (and 20 dollars in a time of need) long ago. To identify the man, a letter with the sack suggests that anyone who claims to know what the advice was should write the remark down and submit it to Reverend Burgess, who will open the sack at a public meeting and find the actual remark inside. News of the mysterious sack of gold spreads throughout the town and even gains attention across the country.
The residents beam with pride as stories of the sack and Hadleyburg's honesty spread throughout the nation, but the mood soon changes. Initially reluctant to give into the temptation of the gold, soon even the most upstanding citizens are trying to guess the remark.
Mr. and Mrs. Richards, one of the town's 19 model couples, receive a letter from a stranger revealing the remark: "You are far from being a bad man: go, and reform". Mrs. Richards is ecstatic that they will be able to claim the gold. Unbeknownst to one another, all 19 couples have received exactly the same letter. They submit their claims to Burgess and begin to recklessly purchase things on credit in anticipation of their future wealth.
The town hall meeting to decide the rightful owner of the sack arrives, and it is packed with residents, outsiders, and reporters. Burgess reads the first two claims, and a dispute quickly arises between two members of the town, "Shadbelly" Billson and Lawyer Wilson. Both of their letters contain nearly the same remark. To settle which is right, Burgess cuts open the sack and finds the note that reveals the full remark: "You are far from being a bad man—go, and reform—or, mark my words—some day, for your sins you will die and go to hell or Hadleyburg—try and make it the former". Neither man's claim includes the second half of remark.
The next claim reads the same, and the town hall bursts into laughter at the obvious dishonesty behind the identical, incorrect claims. Burgess continues to read the rest of the claims, all with the same remark, and one by one the prominent couples of the town are publicly shamed. Mr. and Mrs. Richards await their name with anguish, but surprisingly it is never read.
With all the claims presented, another note in the sack is opened. It reveals the stranger's plot and his desire for revenge. He says that it was foolish for the citizens of Hadleyburg to always avoid temptation, because it is easy to corrupt those who have never had their resolve tested. It is discovered the sack contains not gold but lead pieces. A townsperson proposes to auction the lead off and give the money to the Richardses, the only prominent couple in town that did not have their name read off. Mr. and Mrs. Richards are in despair, unsure whether to come clean and stop the auction or to accept the money.
The stranger who set up the whole scheme in the first place is revealed to have been in the town hall the whole time. He contrives to reward the Richardses for their supposed honesty by buying the sack at auction for its price in gold.
The following day the stranger delivers checks totaling $40,000 to the Richardses. They fret about whether they should burn them. A message arrives from Burgess, explaining that he intentionally kept the Richardses' claim from being read as a way to return an old favor done to him by Mr. Richards.
Mr. and Mrs. Richards become distraught over their situation. They grow paranoid and start to think Burgess has revealed their dishonesty to other people in the town. Their anxiety causes them both to fall ill and Mr. Richards confesses their guilt shortly before he and his wife die. Hadleyburg, with its reputation irreparably damaged, decides to rename itself. The story ends with the line "It is an honest town once more, and the man will have to rise early that catches it napping again".