The peddler lives as a tramp, wandering the roads and selling rattraps. He likes to think of the world as one big rattrap that offers bait for people in the form of luxury and pleasure, and then ensnares them.
One evening in late December, the peddler comes to a cabin and asks for shelter. The old man who lives there welcomes him in, offering food, tobacco, and conversation. He shows the peddler thirty kronor that he has earned from selling his cow’s milk.
The next morning the peddler leaves, but then he returns to steal the old man’s money. He goes into the forest to avoid detection, but soon finds himself lost. He realizes that he has been caught in the “rattrap,” and fears that he will die. The peddler then hears hammering and finds that he is near an ironworks. He takes shelter there by the warm furnace, where the master blacksmith and his apprentice are working.
The ironworks are owned by a wealthy ironmaster, who frequently visits the forge. He comes by that night and sees the peddler. Mistaking the peddler for an old regimental comrade, Captain von Stahle, the ironmaster invites him to come back to his manor house and spend Christmas with him and his daughter. Though the peddler first pretends to be von Stahle, he declines the ironmaster’s invitation, afraid to go to the house with his stolen money. The ironmaster reluctantly leaves.
Soon after, the ironmaster’s daughter Edla Willmansson arrives at the forge, sent by her father to persuade the peddler to come to their home. She notes that the man looks afraid and is probably hiding from some past crime, but she treats him kindly and assures him that he can leave freely whenever he wants. The peddler agrees to come with her.
The next morning, the ironmaster and Edla greet the peddler, who has been bathed and dressed in fine clothes. The ironmaster realizes he made a mistake—the stranger is not Captain von Stahle—and gets angry. The peddler offers to put his rags back on and leave, but the ironmaster threatens to call for the sheriff. This angers the peddler, who rants about how the whole world is a rattrap, and the ironmaster should consider that he might be caught one day too. This amuses the ironmaster, who agrees to let the peddler go without calling the sheriff. Edla stops him, however, and says that she wants the peddler to stay. She knows that he has a hard life and declares that he should have some warmth and safety on Christmas Eve, especially because they already promised him their hospitality. The ironmaster grumbles but agrees.
The peddler, amazed by Edla’s words, sleeps for most of the day, only waking for meals. At dinner, Edla tells him that he is to keep the suit he’s wearing as a gift. She also tells him that he will be welcome back next Christmas. The peddler is again amazed.
The next morning, which is Christmas, the ironmaster and Edla go to church, where they learn that the stranger staying with them is a thief who stole money from the old man. Edla is ashamed, and the ironmaster worries that they might have been robbed as well. When they return home, however, the peddler has left, taking nothing and leaving behind a package for Edla. Inside is the stolen money, a rattrap, and a letter. The letter thanks Edla for her kindness, and states that she has freed the peddler from being caught in the “rattrap” of life. He signs the letter as Captain von Stahle.