After spending nineteen years in prison for stealing a loaf of bread, Jean Valjean is refused lodging at Digne because he is an ex-convict. Just when he is about to give up, M. Myriel, the Bishop of Digne, offers him dinner and a place to spend the night. Later that night, Valjean finds himself unable to resist stealing the Bishop's silver; he is arrested by the police the next morning. But M. Myriel pretends that he gave Valjean the silver as a gift, making him promise to reform and become an honest man. The Bishop's lesson deeply affects Valjean, who eventually redeems his dark past through financial prosperity, renewed spiritual faith, and philanthropy. Posing as "M. Madeleine," Valjean becomes the mayor of Montreuil-sur-mer, bringing prosperity to the entire region and acquiring a widespread reputation for his charity and devotion to the poor.
Even though the local police inspector, Javert, is suspicious of him, Valjean intervenes in the arrest of a prostitute named Fantine.
Before selling her body, she had sold her hair and two front teeth in order to support her daughter, Cosette, whom she left at the ThÃÂ©nardier tavern. She first rejects Valjean's offer to help her retrieve Cosette, spitting in his face because she thinks he was responsible for her being fired from his factory. He insists that he wants to help, but before he can, a serious moral dilemma causes him to leave town. A man named Champmathieu is about to be convicted for being Jean Valjean; after debating what to do for an entire night, the real Valjean decides to turn himself in. Fantine dies just before he is arrested, and Valjean vows to take care of Cosette.
After faking his death, Valjean escapes from prison and liberates Cosette from the depraved ThÃÂ©nardiers. They move to Paris and soon love each other as father and daughter. Javert, however, has refused to give up on his search for Valjean and eventually learns where he lives in Paris. Valjean realizes that he is in danger, and, after an agonizing and suspenseful pursuit throughout Paris, Valjean and Cosette just barely escape by hiding in the Petit Picpus Convent. They end up staying there for a few years, while Valjean avoids the police and Cosette gets an education.
The narrator then introduces Marius Pontmercy, the son of a famous Napoleonic colonel. Marius' maternal grandfather, a staunch monarchist named M. Gillenormand, refuses to let Marius' father, Georges Pontmercy, have custody of Marius for political reasons, threatening to disown Marius if he refuses. His father reluctantly agrees, and it is not until he dies that Marius begins to love him. Marius soon becomes an ardent supporter of Napoleon and this political difference with his grandfather forces him to move out. He joins a student-led group of revolutionaries, the Friends of the ABC, but his support for the defunct French Empire puts him at odds with the other members and he quits. Marius suffers through poverty just barely managing to get by. But his spirits soon rise when he falls in love with a woman he sees at the Luxembourg Gardens--none other than Cosette.
Even though Cosette gives Marius a suggestive look one day, they have yet to meet, and Marius soon loses track of both Cosette and Jean Valjean (whom Marius nicknames "Leblanc"). Marius becomes depressed after not seeing Cosette for the whole winter, but his luck soon changes. One day, while spying on his neighbors, the Jondrettes, through a crack in the wall, Marius sees Valjean and Cosette doing charity work. He is deliriously happy, but is unable to follow them home after overhearing the Jondrettes planning to rob Valjean when he returns later that evening to pay their rent. Horrified, Marius runs to the police station, where Javert enlists his help to catch the criminals in the act. When Valjean returns that evening, Jondrette, revealing himself to be ThÃÂ©nardier, ambushes him and demands 200,000 francs. Javert arrives just in time to prevent the robbery, but Valjean jumps out a window to prevent being seen by the inspector.
Marius and Cosette finally meet in secret and fall in love. But their happiness comes to an abrupt halt when Valjean, afraid of both Marius and the political unrest in France, takes Cosette to England. Depressed again at the loss of his love, Marius joins the ranks of his revolutionary friends who are planning an insurrection. Just before the fighting, Javert is discovered to be a spy among the students' ranks, and is sentenced to die. For the sake of Cosette, Valjean joins the insurrection to protect Marius. He offers to execute Javert, but when no one is looking, he sets Javert free. Although Marius is critically wounded during the fighting, Valjean manages to save him via a dangerous trip through the Paris sewers. Surprisingly, Javert is waiting for Valjean at the sewer exit, but allows him to return Marius to his grandfather. Humiliated at having let Valjean go, Javert commits suicide. Meanwhile, Marius survives not knowing who saved him. Valjean tells Marius that he is an ex-convict, and Marius begins to alienate him from Cosette. Just before Valjean dies, however, Marius learns that he saved his life after the battle. He and Cosette manage to reconcile with Valjean and declare their love for him and each other as he passes away.