At the beginning of The Mayor of Casterbridge, Michael Henchard sells his wife and baby daughter to the highest bidder while drunk. He immediately regrets his actions and swears off drink for years. In time, he builds himself up, becoming the mayor of the town, and his wife and daughter eventually return to him, nearly two decades later. The novel examines the importance of a person's reputation, as Henchard eventually loses everything again after his past actions and relationships are revealed.
At a country fair near Casterbridge, Wessex, a young hay-trusser named Michael Henchard gets drunk on rum-laced furmity and argues with his wife, Susan. He decides to auction off his wife and baby daughter, Elizabeth-Jane, to a sailor, Mr. Newson, for five guineas. Sober the next day, he is too late to recover his family. When he realises that his wife and daughter are gone, he swears not to touch liquor again for as many years as he has lived so far (21).
Eighteen years later, Henchard is now a successful grain merchant and Mayor of Casterbridge, known for his staunch sobriety. Henchard has avoided explaining the circumstances of the "loss" of his wife, allowing people to assume he is a widower.
On a visit to Jersey on business, Henchard falls in love with Lucette Le Sueur, who nurses him back to health after an illness. Although Henchard never tells Lucetta exactly how he "lost" his wife, he does tell her he has a wife who "is dead probably dead, but who may return". Besotted, Lucetta develops a relationship with him despite the risk. The book implies that they have a sexual relationship, and Lucetta's reputation is ruined. Henchard returns to Casterbridge, leaving Lucetta to face the social consequences of their fling.
To rejoin polite society Lucetta would have to marry him, although Henchard is already technically married. Yet just as Henchard is about to send for Lucetta, Susan unexpectedly appears in Casterbridge with her daughter, Elizabeth-Jane. Newson appears to have been lost at sea, and without means to earn an income Susan is looking to Henchard again. Susan believed for a long time that her "marriage" to Newson was perfectly legitimate. Only recently, just before Newson's disappearance, had Susan begun to question whether or not she was still legally married to Henchard.
Just as Susan and Elizabeth-Jane arrive in town, a Scotsman, Donald Farfrae, is passing through on his way to America. He has experience as a grain and corn merchant, and is on the cutting edge of agricultural science. He befriends Henchard and helps him out of a bad financial situation by giving him some timely advice. Henchard persuades him to stay and offers him a job as his corn factor, rudely dismissing a man named Jopp to whom he had already offered the job. Hiring Farfrae is a stroke of business genius for Henchard, who, although hardworking, is not well-educated.
To preserve appearances, Henchard sets Susan up in a nearby house, pretends to court her, and remarries her. Both Henchard and Susan keep the truth from Elizabeth-Jane. Henchard also keeps Lucetta a secret. He writes to her, informing her that their marriage is off.
Henchard's relationship with Farfrae deteriorates as Farfrae becomes more popular than Henchard. Eventually they part company and Farfrae sets himself up as an independent merchant. The rivalry and jealousy for the most part is one-sided, and Farfrae conducts himself with scrupulous honesty and fair dealing. Henchard meanwhile makes increasingly aggressive, risky business decisions that put him in financial danger.
Henchard's jealousy leads him to oppose a marriage between Farfrae and Elizabeth-Jane, until after Susan's death, at which point Henchard learns he is not Elizabeth-Jane's father from a letter which Susan, on her deathbed, marked to be opened only after Elizabeth-Jane's marriage. His own daughter had died in infancy; this second Elizabeth-Jane is Newson's daughter. Henchard is no longer concerned about blocking the marriage, but he conceals the secret from Elizabeth-Jane and grows cold and cruel towards her.
In the meantime, Lucetta arrives from Jersey and purchases a house in Casterbridge. She has inherited money from a wealthy relative. Initially she hopes to resume their relationship, but propriety requires that they wait a while. She takes Elizabeth-Jane into her household as a companion, thinking it will give Henchard an excuse to come to visit, not knowing of Henchard's hatred of Elizabeth-Jane.
Farfrae visits Lucetta's house to see Elizabeth-Jane and falls for Lucetta, not knowing she has come to marry Henchard. Lucetta is also attracted to Farfrae. At the same time, she begins to question Henchard's character, when it becomes public knowledge that he sold his first wife. Although initially reluctant, Henchard decides that he wants to marry Lucetta, particularly since he is in financial trouble - he believes that his creditors would extend credit if he was about to be married to a wealthy woman. Frustrated by her stalling, Henchard bullies Lucetta into agreeing to marry him. But by this point she is in love with Farfrae, and they run away one weekend to get married. She does not tell Henchard until well after the fact. Henchard's credit collapses, he goes bankrupt, and has to sell all his personal possessions to pay creditors.
Farfrae buys Henchard's old business and tries to help the man who helped him get started, whom he still regards as a friend and a former mentor, by employing him as a journeyman. He does not realise Henchard is his enemy, even though the town council and Elizabeth-Jane both warn him.
Lucetta keeps her former relationship with Henchard a secret, but all is revealed when Henchard lets his enemy Jopp deliver Lucetta's old love letters. Jopp makes the secret public and the townspeople publicly shame Henchard and Lucetta in a skimmington ride. Lucetta, who by this point is pregnant, dies of an epileptic seizure.
When Newson, Elizabeth-Jane's biological father, returns, Henchard is afraid of losing her companionship and tells Newson she is dead. The twenty-first year of his oath is up, and he starts drinking again. By the time Elizabeth-Jane, who months later is married to Donald Farfrae and reunited with Newson, goes looking for Henchard to forgive him, he has died and left a will requesting no funeral.