The novel opens on a dirt road near the village of Weydon-Priors, in the English county of Wessex. Michael Henchard, a hay-trusser, is traveling with his wife, Susan, and young daughter, Elizabeth-Jane. However, a passing farmer tells the Henchards that there is no chance of finding employment or housing in the village. Discouraged, Michael takes his family to a furmity seller's tent in Weydon-Priors. The furmity seller adds liquor to Michael's meal, and after several servings Michael becomes an angry drunk. Because he believes his marriage at a young age ruined all his chances for success, he offers to sell his wife and daughter to the highest bidder. After several unanswered calls for bids, Susan says that someone should buy her, since her present owner isn't to her liking. Most of the other customers in the tent treat the auction as a joke, but soon a passing sailor hears the announcements and enters the tent. He offers to buy Susan and Elizabeth-Jane for five guineas, first making sure that Susan is willing to go. When Michael takes the money, Susan and Elizabeth-Jane leave with the sailor. Before leaving, Susan hurls her wedding-ring at Michael. Michael merely falls into a drunken slumber as the rest of the shocked customers leave.
The next morning, Michael awakens. Seeing the wedding ring and the money brings the events of the previous evening back to him. He realizes that he was partly to blame for his actions, but he also blames Susan for actually thinking that the auction would be binding. Nevertheless, because his excessive drinking caused the whole situation, he makes an oath: he will abstain from all liquor for twenty-one years. Then he sets out to search for his wife and daughter. At first the search is unsuccessful because Michael refuses to explain the circumstances of their parting. Finally he learns that three people matching the descriptions of the sailor, Susan, and Elizabeth-Jane have just emigrated. Resigned, Michael gives up the search and goes to another town in Wessex, the town of Casterbridge.
Eighteen years later, Susan and Elizabeth-Jane return to Weydon-Priors searching for Michael. Elizabeth-Jane believes that Michael is just a relative, since Susan has kept her previous marriage a secret. Susan seeks Michael because she believes that he can help them now that the sailor, named Newson, has died. The women stop in the furmity seller's tent, which is still there. They learn that Michael stopped in the tent a year after the auction and left word that he lived in Casterbridge. Susan and Elizabeth-Jane leave for Casterbridge right away.
When the women arrive in Casterbridge, they learn that Michael has become extremely influential as a prosperous merchant and as the mayor of the town. The night they arrive, the townspeople are discussing Michael's bad business deals in selling sprouted grain. A young Scotsman, Donald Farfrae, overhears the discussion and gives Michael some suggestions for making the grain usable. Farfrae also engages in a light flirtation with Elizabeth-Jane.
Eventually Michael and Susan meet secretly. They decide to keep their past relationship a secret from Elizabeth-Jane. In fact, Michael suggests that they begin their relationship again. Susan should rent a cottage and allow Michael to court her in a respectable manner. Susan complies, and soon after they marry. Michael hopes that someday he can openly acknowledge Elizabeth-Jane as his daughter. At the same time, Michael has success in business as well by choosing Farfrae as his general manager and confidant. Farfrae's charm impresses all the townspeople and gains the attentions of Elizabeth-Jane once again. Michael has taken the young man under his wing and regards him almost as a brother. The only enemy Farfrae has is Joshua Jopp, a man who wanted the position of general manager.
When Susan and Michael remarry, Michael has another period of prosperity thanks to Farfrae's skills. The new wealth to which Elizabeth-Jane has been introduced produces a new beauty in her. Michael becomes fond of her and wants her to take his name legally. Susan, however, is reluctant to agree. Farfrae also takes an interest in Elizabeth-Jane. However, Elizabeth-Jane's shyness and discord between Farfrae and Michael have stopped any hope of a romance. Farfrae and Michael first have a disagreement over the punishment for an habitually late worker, Abel Whittle. Next, during a public celebration, Farfrae's diversions are a success while Michael's are a complete failure. The townspeople openly praise Farfrae, which leads Michael to remark that Farfrae's term as general manger is ending. Farfrae resigns and opens up his own corn and hay store.
Susan dies, leaving a letter for Michael that is not to be opened until Elizabeth-Jane's wedding-day. Michael is lonely from the arguments with Farfrae and the lack of any tie with Elizabeth-Jane, so he tells the girl that he is her father. After thinking it over, Elizabeth-Jane is convinced. Meanwhile, Michael finds Susan's letter and reads it. The letter reveals that Michael's own daughter died, and this Elizabeth-Jane is the child of the sailor Newson. The discovery shocks and angers Michael, and he becomes cold to Elizabeth-Jane without telling her the truth.
Elizabeth-Jane is confused, but tries to win the love of Michael by immersing herself in her studies. She also visits her mother's grave. One day she meets a wealthy and charming young woman at Susan's grave, and she pours out her story to the woman. The lady, Miss Lucetta Templeman, says she will soon be a resident of Casterbridge, and she would like it if Elizabeth-Jane can be her companion. Michael allows it despite his misgivings, and Elizabeth-Jane leaves that day.
Lucetta invites Michael to her home, even going so far as to send Elizabeth-Jane away on errands just to convince him to visit. Michael and Lucetta had an agreement long ago when he was in Jersey, but it had been put on hold because of his marriage. Now that Susan is dead, Lucetta wishes to renew the agreement. To her joy, a caller comes--but it is Farfrae coming to call on Elizabeth-Jane. Lucetta and Farfrae are instantly attracted to each other, and she begins to ignore Michael completely. While Michael tries to propose to Lucetta despite the presence of an unknown rival, Elizabeth-Jane realizes that Farfrae and Michael are in love with Lucetta, and she renounces any interest she may have had in Farfrae.
The competition between Farfrae and Michael extends into business, complicating the situation. Michael hires Joshua Jopp as his general manager, and orders Jopp to do all he can to force Farfrae out of business. Michael tries to base his grain purchase on the predictions of a weather-prophet, but the prediction is incorrect, and the bad investment drives Michael into debt. Farfrae buys wisely and gains money.
Despite his losses, Michael is still determined to marry Lucetta. After learning that Farfrae is the secret suitor, Michael forces Lucetta to agree to marrying him--or he will reveal their past connection by using her earlier love letters. Lucetta reluctantly agrees. The next day, Michael hears the trial of an old woman. The old woman is the furmity seller from long ago, and she tells the story of the wife auction. Lucetta is so horrified that she runs away to Port-Bredy. There she marries Farfrae secretly, and she tells Michael a few days later.
Meanwhile, Michael has terrible luck in business. One of his debtors fails; his men make bad decisions about corn to bring about Michael's bankruptcy. Farfrae takes the opportunity to buy Michael's headquarters and offer a job to Michael. Michael accepts, but feels real hatred at Farfrae's success. After all, Farfrae is the popular choice for mayor, and he has Lucetta. Michael looks forward to the ending of his oath not to drink liquor.
Elizabeth fears that Michael will hurt Farfrae, and the townspeople know all about Michael's hatred of Farfrae. Although Farfrae gives up the idea of giving Michael his own shop, he cannot leave Casterbridge because he is offered the position of mayor. Lucetta begs Michael to return her letters, and a combination of pity and contempt makes him agree.
Joshua Jopp meets Lucetta after her meeting with Michael. He asks her to help him get a position with Farfrae. Lucetta refuses. Michael gives Jopp a package to deliver to Lucetta, and Jopp reasons that they are love letters. He shares the letters with some poor townswomen who hate Lucetta. They plan to have a skimmity-ride through town the next night. When the effigies of Michael and Lucetta ride through town, Lucetta sees and is so shocked that she has a seizure that kills her.
The whole world has crashed around Michael, yet he still has the love of Elizabeth-Jane. Even this reconciliation is threatened by a surprise visit from Newson, whom everyone thought dead. Michael tells him that Elizabeth-Jane is dead, and the sailor accepts this, then leaves. Although Michael and Elizabeth-Jane soon settle into a peaceful life, Michael constantly worries about Newson's return.
Meanwhile, Farfrae returns to court Elizabeth-Jane. Michael is nervous about their courtship, and he becomes even more nervous when Elizabeth-Jane says she must meet someone. She meets Newson, who tells her the truth about her birth. At the wedding of Elizabeth-Jane and Farfrae, Michael comes to reconcile with his step-daughter, but he sees Newson and decides to never trouble Elizabeth-Jane again. Later, Elizabeth-Jane realizes that Michael wanted to make peace with her, and she sets out to find him. Abel Whittle, the man whom Michael wanted to fire once, cared for Michael in his last days. He tells Elizabeth-Jane that Michael is dead. Michael's last will states that no man should remember him. Elizabeth-Jane resolves to do as she is told, preferring to concentrate all her love on her husband and family.