In a fit of drunken irritation, Michael Henchard, a young, unemployed hay-trusser, sells his wife Susan and his infant daughter Elizabeth-Jane to a sailor during a fair in the village of Weydon-Priors. Eighteen years later, Susan and Elizabeth-Jane return to seek him out but are told by the "furmity woman," the old hag whose concoction had made Henchard drunk at the fair, that he has moved to the distant town of Casterbridge. The sailor has been reported lost at sea.
Susan and Elizabeth-Jane, the latter innocent of the shameful sale eighteen years before, reach Casterbridge, where they discover that Henchard has become the mayor and one of the wealthiest businessmen in the area. Henchard, out of a sense of guilt, courts Susan in a respectable manner and soon after remarries her, hoping that one day be will be able to acknowledge Elizabeth-Jane as his daughter. Concurrently with Susan's return, Henchard hires Donald Farfrae, a young Scotsman, as his business manager. After a short while, Susan dies, and Henchard learns that his own daughter had died many years earlier and that Elizabeth-Jane is really the illegitimate daughter of Newson, the sailor, Susan's second "husband."
Lucetta Templeman, a young woman from Jersey with whom Henchard has had a romantic involvement, comes to Casterbridge with the intention of marrying Henchard. She meets Farfrae, however, and the two are deeply attracted to each other. Henchard, disturbed by Farfrae's prestige in the town, has dismissed him, and Farfrae sets up his own rival business. Shortly after, Farfrae and Lucetta are married.
Henchard's fortunes continue their decline while Farfrae's advance. When Henchard's successor as mayor dies suddenly, Farfrae becomes mayor. Henchard's ruin is almost completed when the "furmity woman" is arrested as a vagrant in Casterbridge and reveals the transaction two decades earlier when Henchard sold his wife. Then, by a combination of bad luck and mismanagement, Henchard goes bankrupt and is forced to make his living as an employee of Farfrae's.
Lucetta, now at the height of her fortunes, has staked everything on keeping her past relationship with Henchard a secret. Her old love letters to him, however, find their way into the hands of Henchard's vengeful ex-employee, Jopp, who reveals them to the worst element in the town. They organize a "skimmity-ride," in which Henchard and Lucetta are paraded in effigy through the streets. The shock of the scandal kills Lucetta.
Now an almost broken man, Henchard moves to the poorest quarters, where his life is made tolerable only by Elizabeth-Jane's kindness and concern. Even his comfort in her affection is threatened, however, when Newson, the sailor, returns in search of his daughter. Henchard's lie to Newson that Elizabeth-Jane has died is eventually discovered, and Elizabeth-Jane, his last source of comfort, turns against him.
Farfrae, after a period as a widower, renews his interest in Elizabeth-Jane. They are married and Henchard, when he comes to deliver a wedding gift, finds Newson enjoying his position as the bride's father. Heartbroken, Henchard leaves and shortly afterwards dies in an abandoned hut, attended only by the humblest and simplest of his former workmen. The novel closes when Farfrae and Elizabeth-Jane find the place where he has died and read his terrible will of complete renunciation.