Jean Valjean, after spending nineteen years in jail and in the galleys for stealing a loaf of bread and for several attempts to escape, is finally released, but his past keeps haunting him. At Digne, he is repeatedly refused shelter for the night. Only the saintly bishop, Monseigneur Myriel, welcomes him. Valjean repays his host's hospitality by stealing his silverware. When the police bring him back, the bishop protects his errant guest by pretending that the silverware is a gift. With a pious lie, he convinces them that the convict has promised to reform. After one more theft, Jean Valjean does indeed repent. Under the name of M. Madeleine he starts a factory and brings prosperity to the town of Montreuil.
Next, Hugo introduces the pathetic young girl Fantine. Alone and burdened with an illegitimate child, she is on the way back to her hometown of Montreuil, to find a job. On the road, she entrusts her daughter to an innkeeper and his wife, the Thénardiers.
In Montreuil, Fantine finds a job in Madeleine's factory and attains a modicum of prosperity. Unfortunately she is fired and, at the same time, must meet increasing financial demands by the Thénardiers. Defeated by her difficulties, Fantine turns to prostitution. Tormented by a local idler, she causes a disturbance and is arrested by Inspector Javert. Only Madeleine's forceful intervention keeps her out of jail. She catches a fever, however, and her health deteriorates dangerously. Death is imminent and M. Madeleine promises to bring her daughter, Cosette, to her.
Madeleine, however, is faced with serious problems. A man has been arrested as Jean Valjean and is about to be condemned for his crimes. After a night of agonizing moral conflict, Madeleine decides to confess his past. At Arras, the seat of the trial, he dramatically exonerates the accused. A few days later, he is arrested by Javert at Fantine's bedside. The shocking scene kills the young woman.
That same night Valjean escapes, but he is quickly recaptured and sent to Toulon, a military port. One day he saves a sailor about to fall from the rigging. He plunges into the sea and manages to escape by establishing the belief that he has drowned. He uses his precarious freedom to go to Montfermeil, the location of the Thénardiers' inn. After burying his money in the woods, he frees Cosette from the Thénardiers' abominable guardianship and takes her into the protective anonymity of Paris.
In Paris, he lives like a recluse in a dilapidated tenement, the Gorbeau House, in an outlying district. In spite of his precautions, however, Javert manages to track him down. Valjean is forced to flee abruptly. After a hectic chase and imminent capture, he finds a miraculous refuge in a convent. With the cooperation of the gardener, Fauchelevent, a man whose life he has saved in the past, Valjean persuades the prioress to take him on as assistant gardener and to enroll Cosette as a pupil. Valjean and Cosette spend several happy years in the isolation of the convent.
Hugo now turns to another leading character, Marius. Marius is a seventeen-year-old who lives with his grandfather, M. Gillenormand, a relic of the Old Regime. In a nearby town, Georges Pontmercy, Marius' father, a hero of the Napoleonic wars, lives in retirement. M. Gillenormand, by threatening to disinherit Marius, has forced Georges Pontmercy to relinquish custody of his son. He has completed the estrangement by communicating his aversion for Pontmercy to Marius. Consequently, the young man reacts almost impassively to his father's death. A fortuitous conversation reveals to Marius the depths of his father's love for him, and indignant at his grandfather's deception, he leaves home.
He takes refuge in the Latin Quarter and falls in with a group of radical students, the Friends of the A.B.C. Marius, who under his father's posthumous influence has just switched his allegiance from the monarchy to Napoleon, falls into a state of intellectual bewilderment. Material difficulties increase his unhappiness. Finally he manages to create a tolerable existence by finding a modest job, living frugally, and withdrawing into his inner dreams.
His peace is shattered when he falls passionately in love with a beautiful young girl in the Luxembourg Gardens. She is Jean Valjean's ward, Cosette. Too timid for bold actions, he courts her silently. A fatal indiscretion ruins his nascent love affair. He quizzes the doorman where the girl lives and a week later she moves without leaving an address. For a long time Marius is unable to find a clue to his sweetheart's whereabouts and is overcome by despair.
Coincidence puts him back on the track. One day curiosity impels him to observe his neighbors through a hole in the wall. He glimpses a family — father, mother, and two daughters — living in unspeakable squalor. Soon after he witnesses the entrance of a philanthropist, M. Leblanc, and his daughter. To his immense surprise, the daughter is Cosette. His jubilation is replaced by consternation when he discovers that his neighbors are planning to draw M. Leblanc into a trap the same evening. Marius contacts the police and on the instructions of Inspector Javert returns to his room.
When Leblanc comes back, Marius' neighbor identifies himself as Thénardier, ties up his victim, and demands an exorbitant ransom. The plot fails with the timely arrival of the inspector. In the confusion of the arrest, Leblanc escapes.
Once again, the young girl has vanished. But Thénardier's daughter, who is selflessly in love with Marius, manages to find his sweetheart for him.
After worshiping Cosette from afar, Marius summons the courage to declare his love. Cosette reciprocates. For a whole month the couple lives a chaste and secret idyll, secret because Cosette intuitively guesses Valjean's hostility to the man who is usurping his place.
Marius' happiness is unwittingly shattered by Valjean, who, disturbed by a secret warning and the growing popular unrest in Paris, has decided to take Cosette to England. As a first step he moves to a hideaway prepared for this kind of emergency.
Absorbed by his love, Marius has been unaware of the deteriorating political situation. Now his private crisis is echoed by the crisis of an imminent insurrection. His friend Enjolras directs the erection of a barricade in front of the Corinth wine shop. The first enemy he has to deal with is found within the rebels' ranks. It is Javert, who is unmasked as a spy and tied up to await execution.
Marius, driven by despair, decides to seek death in the insurrection. He joins the fighters at the barricade and fights valiantly to the end. Valjean also joins the insurgents, but for special reasons. He has discovered Marius' relationship with Cosette and his role in the revolution. For Cosette's sake, he decides to protect the life of the man he abhors.
Before the final assault, Valjean volunteers to execute Javert. Instead, he spares the inspector's life and sends him away. Then Valjean returns to the barricade as the few surviving defenders are driven inside the wine shop. He seizes the seriously wounded Marius, disappears into a manhole, and undertakes a heroic and harrowing passage through the sewers of Paris. Unfortunately, Javert arrests him at the exit. However, he allows Valjean to take Marius to his grandfather and later, in a quandary, releases Valjean. But he cannot forgive himself for this breach of duty and commits suicide.
Marius' life has a happier ending. He recuperates from his wounds and overcomes his grandfather's hostility to his marriage. The marriage, however, is a mortal blow to Valjean. He has confessed his past to Marius, and the latter, in spite of his magnanimity, slowly estranges Cosette from Valjean. Marius does not know that Valjean is the man who saved his life in the sewers. Without Cosette, Valjean's life loses its meaning and he slowly withers away. Thénardier, however, unwittingly reveals to Marius that Valjean is his savior, and Marius and Cosette arrive in time to console Jean Valjean on his deathbed.