After nineteen years as a prisoner on the chain gang, Jean Valjean is released on parole with his yellow ticket-of-leave, which he must always carry with him, always branding him as a thief. Only the Bishop of Digne invites him in and treats him with compassion. In desperation, Valjean steals some silver. When the police catch him, he says it was a gift from the bishop, who goes along with the story. The bishop then, in addition, gives him two silver candlesticks. Valjean realizes he has given him a chance to regain his soul. He decides to start a new life for the better. To do so he realizes he must change his identity and break parole, and he tears up his yellow ticket.
Eight years pass and Valjean, now known as Monsieur Madeleine, is now a factory owner and the mayor of a small town. One of his factory workers, Fantine, has a secret illegitimate child who lives with innkeepers in another town. The other women at the factory discover this and demand her discharge, insisting she will be nothing but trouble. The foreman, whose advances she has rejected, fires her.
Now without an income, Fantine is desperate for money to pay for medicines for her supposedly sick daughter. She sells her locket, then her hair, and eventually becomes a prostitute. Her new trade disgusts her, and, when she refuses a prospective customer, he claims she attacked him. Inspector Javert prepares to send her to prison. The mayor (Valjean) steps in and insists she be taken to a hospital instead, for she is ill. He recognizes her from his factory and promises to help her.
Suddenly, an elderly man is pinned under a runaway cart. Valjean saves him by lifting the cart, a feat that requires extraordinary strength. Javert remembers the unusual strength of Prisoner 24601 (Valjean), a parole-breaker whom he has been hunting for years. However, a man has just been arrested who is to be tried as 24601. Valjean refuses to let an innocent man go to prison for him, and confesses to the court that he is Prisoner 24601.
At the hospital, as Fantine is dying, Valjean promises to take care of her daughter, Cosette. For five years, Cosette has lived with a horrible couple, the Thénardiers, who run an inn in Montfermeil and treat her miserably. Their daughter Eponine, whom they spoil, is the same age. Valjean arrives to find a frightened Cosette in the dark forest carrying water from the well. He pays the Thénardiers to let him take Cosette away.
Nine years later, there is general unrest in Paris. Gavroche, a street urchin, mingles with beggars and prostitutes. Thénardier has moved there, and he and his gang, including Eponine, prey upon others to survive. Valjean and Cosette appear, and Eponine, now a young woman, remembers Cosette from their childhood. Eponine is in love with Marius, a student, who is in love with Cosette. Marius begs Eponine to help him find Cosette, and, heartbroken, she agrees.
Eponine grudgingly brings Marius to Cosette’s home, and then stops an attempted robbery by her father’s gang at Valjean’s house. Valjean, who has not told Cosette of his past, prepares to move them away, afraid that Javert has finally discovered him. Meanwhile, the students are planning an uprising.
The students, including Marius, build a barricade in the street, and are told to surrender by an army officer. Javert pretends to ally with the students, Gavroche identifies he as a spy and he is tied up, to be dealt with later.
Eponine returns, but has been shot crossing the barricade. She dies in Marius’s arms as the first victim of the student’s insurrection. Valjean arrives in search of Marius. He kills a sniper and proves to the students he supports their cause. In return, he asks to be given charge of Javert. Instead of killing him, he shows him mercy and lets him go.
The students hold their ground in the first assault. As they settle in for the night, they reflect on their friendships and toast to days gone by. Valjean realizes the depth of Marius’s love for Cosette and prays for his safety in the battle that is to come.
Dawn breaks, and, with ammunition running low, Gavroche goes to collect more—but is instantly shot and killed. Once again, the rebels are told to surrender. They refuse, and a fierce attack begins. Only Valjean and Marius survive, though Marius is badly wounded. Valjean takes the unconscious Marius down a manhole into the sewer to protect him. Javert returns to the barricade to look for Valjean’s body. Not finding him among the dead, he determines he must have escaped into the sewer.
When Javert does eventually find him, Valjean entreats him for time to deliver Marius to a hospital before surrendering to Javert. Javert reluctantly agrees and says he’ll be waiting. However, now Javert is desperately conflicted by the mercy Valjean has shown him. Unable to live in the debt of a thief he throws himself off a bridge into the Seine River below.
Marius also grieves over the loss of his friends, and wonders about his rescuer as he recuperates. He and Cosette talk of their upcoming wedding and invite Valjean to live with them after they are married. He is grateful but confesses the truth about his past to Marius, explaining that Cosette knows nothing about his real identity and to stay would disgrace and endanger them both. Marius agrees to never reveal the truth to Cosette.
The lovers are married. The Thénardiers come to the wedding to try to blackmail Marius for money, saying they know the truth about Valjean’s real identity. As a result, Marius learns that it was Valjean who saved him the night the barricade fell. He and Cosette hurry off to find Valjean, where at last Cosette discovers the truth about her past before Valjean dies. The spirits of Fantine and Eponine come to take him to heaven, joined by all those who died on the barricade.