Volume I – Fantine
The story begins in 1815 in Digne, as the peasant Jean Valjean, just released from 19 years' imprisonment in the galleys—five for stealing bread for his starving sister and her family and fourteen more for numerous escape attempts—is turned away by innkeepers because his yellow passport marks him as a former convict. He sleeps on the street, angry and bitter.
Digne's benevolent Bishop Myriel gives him shelter. At night, Valjean runs off with Myriel's silverware. When the police capture Valjean, Myriel pretends that he has given the silverware to Valjean and presses him to take two silver candlesticks as well, as if he had forgotten to take them. The police accept his explanation and leave. Myriel tells Valjean that his life has been spared for God, and that he should use money from the silver candlesticks to make an honest man of himself.
Valjean broods over Myriel's words. When opportunity presents itself, purely out of habit, he steals a 40-sous coin from 12-year-old Petit Gervais and chases the boy away. He quickly repents and searches the city in panic for Gervais. At the same time, his theft is reported to the authorities. Valjean hides as they search for him, because if apprehended he will be returned to the galleys for life as a repeat offender.
Six years pass and Valjean, using the alias Monsieur Madeleine, has become a wealthy factory owner and is appointed mayor of a town identified only as M____-sur-M__ (i.e., Montreuil-sur-Mer). Walking down the street, he sees a man named Fauchelevent pinned under the wheels of a cart. When no one volunteers to lift the cart, even for pay, he decides to rescue Fauchelevent himself. He crawls underneath the cart, manages to lift it, and frees him. The town's police inspector, Inspector Javert, who was an adjutant guard at the Bagne of Toulon during Valjean's incarceration, becomes suspicious of the mayor after witnessing this remarkable feat of strength. He has known only one other man, a convict named Jean Valjean, who could accomplish it.
Years earlier in Paris, a grisette named Fantine was very much in love with Félix Tholomyès. His friends, Listolier, Fameuil, and Blachevelle were also paired with Fantine's friends Dahlia, Zéphine, and Favourite. The men abandon the women, treating their relationships as youthful amusements. Fantine must draw on her own resources to care for her and Tholomyès' daughter, Cosette. When Fantine arrives at Montfermeil, she leaves Cosette in the care of the Thénardiers, a corrupt innkeeper and his selfish, cruel wife.
Fantine is unaware that they are abusing her daughter and using her as forced labor for their inn, and continues to try to meet their growing, extortionate and fictitious demands. She is later fired from her job at Jean Valjean's factory, because of the discovery of her daughter, who was born out of wedlock. Meanwhile, the Thénardiers' monetary demands continue to grow. In desperation, Fantine sells her hair and two front teeth, and she resorts to prostitution to pay the Thénardiers. Fantine is slowly dying from an unspecified disease.
A dandy named Bamatabois harasses Fantine in the street, and she reacts by striking him. Javert arrests Fantine. She begs to be released so that she can provide for her daughter, but Javert sentences her to six months in prison. Valjean (Mayor Madeleine) intervenes and orders Javert to release her. Javert resists but Valjean prevails. Valjean, feeling responsible because his factory turned her away, promises Fantine that he will bring Cosette to her. He takes her to a hospital.
Javert comes to see Valjean again. Javert admits that after being forced to free Fantine, he reported him as Valjean to the French authorities. He tells Valjean he realizes he was wrong, because the authorities have identified someone else as the real Jean Valjean, have him in custody, and plan to try him the next day. Valjean is torn, but decides to reveal himself to save the innocent man, whose real name is Champmathieu. He travels to attend the trial and there reveals his true identity. Valjean returns to M____-sur-M__ to see Fantine, followed by Javert, who confronts him in her hospital room.
After Javert grabs Valjean, Valjean asks for three days to bring Cosette to Fantine, but Javert refuses. Fantine discovers that Cosette is not at the hospital and fretfully asks where she is. Javert orders her to be quiet, and then reveals to her Valjean's real identity. Weakened by the severity of her illness, she falls back in shock and dies. Valjean goes to Fantine, speaks to her in an inaudible whisper, kisses her hand, and then leaves with Javert. Later, Fantine's body is unceremoniously thrown into a public grave.
Volume II – Cosette
Valjean escapes, is recaptured, and is sentenced to death. The king commutes his sentence to penal servitude for life. While imprisoned at the military port of Toulon, Valjean, at great personal risk, rescues a sailor caught in the ship's rigging. Spectators call for his release. Valjean fakes his own death by allowing himself to fall into the ocean. Authorities report him dead and his body lost.
Valjean arrives at Montfermeil on Christmas Eve. He finds Cosette fetching water in the woods alone and walks with her to the inn. He orders a meal and observes how the Thénardiers abuse her, while pampering their own daughters Éponine and Azelma, who mistreat Cosette for playing with their doll. Valjean leaves and returns to make Cosette a present of an expensive new doll which, after some hesitation, she happily accepts. Éponine and Azelma are envious. Madame Thénardier is furious with Valjean, while her husband makes light of Valjean's behaviour, caring only that he pay for his food and lodging.
The next morning, Valjean informs the Thénardiers that he wants to take Cosette with him. Madame Thénardier immediately accepts, while Thénardier pretends to love Cosette and be concerned for her welfare, reluctant to give her up. Valjean pays the Thénardiers 1,500 francs, and he and Cosette leave the inn. Thénardier, hoping to swindle more out of Valjean, runs after them, holding the 1,500 francs, and tells Valjean he wants Cosette back. He informs Valjean that he cannot release Cosette without a note from the child's mother. Valjean hands Thénardier Fantine's letter authorizing the bearer to take Cosette. Thénardier then demands that Valjean pay a thousand crowns, but Valjean and Cosette leave. Thénardier regrets that he did not bring his gun and turns back toward home.
Valjean and Cosette flee to Paris. Valjean rents new lodgings at Gorbeau House, where he and Cosette live happily. However, Javert discovers Valjean's lodgings there a few months later. Valjean takes Cosette and they try to escape from Javert. They soon find shelter in the Petit-Picpus convent with the help of Fauchelevent, the man whom Valjean once rescued from being crushed under a cart and who has become the convent's gardener. Valjean also becomes a gardener and Cosette becomes a student at the convent school.
Volume III – Marius
Eight years later, the Friends of the ABC, led by Enjolras, are preparing an act of anti-Orléanist civil unrest on the eve of the Paris uprising on 5–6 June 1832, following the death of General Lamarque, the only French leader who had sympathy towards the working class. Lamarque was a victim of a major cholera epidemic that had ravaged the city, particularly its poor neighborhoods, arousing suspicion that the government had been poisoning wells. The Friends of the ABC are joined by the poor of the Cour des miracles, including the Thénardiers' eldest son Gavroche, who is a street urchin.
One of the students, Marius Pontmercy, has become alienated from his family (especially his grandfather M. Gillenormand) because of his liberal views. After the death of his father Colonel Georges Pontmercy, Marius discovers a note from him instructing his son to provide help to a sergeant named Thénardier who saved Pontmercy's life at Waterloo – in reality Thénardier was looting corpses and only saved Pontmercy's life by accident; he had called himself a sergeant under Napoleon to avoid exposing himself as a robber.
At the Luxembourg Gardens, Marius falls in love with the now grown and beautiful Cosette. The Thénardiers have also moved to Paris and now live in poverty after losing their inn. They live under the surname "Jondrette" at Gorbeau House (coincidentally, the same building Valjean and Cosette briefly lived in after leaving the Thénardiers' inn). Marius lives there as well, next door to the Thénardiers.
Éponine, now ragged and emaciated, visits Marius at his apartment to beg for money. To impress him, she tries to prove her literacy by reading aloud from a book and by writing "The Cops Are Here" on a sheet of paper. Marius pities her and gives her some money. After Éponine leaves, Marius observes the "Jondrettes" in their apartment through a crack in the wall. Éponine comes in and announces that a philanthropist and his daughter are arriving to visit them. In order to look poorer, Thénardier puts out the fire and breaks a chair. He also orders Azelma to punch out a window pane, which she does, resulting in cutting her hand (as Thénardier had hoped).
The philanthropist and his daughter enter—actually Valjean and Cosette. Marius immediately recognizes Cosette. After seeing them, Valjean promises them he will return with rent money for them. After he and Cosette leave, Marius asks Éponine to retrieve her address for him. Éponine, who is in love with Marius herself, reluctantly agrees to do so. The Thénardiers have also recognized Valjean and Cosette, and vow their revenge. Thénardier enlists the aid of the Patron-Minette, a well-known and feared gang of murderers and robbers.
Marius overhears Thénardier's plan and goes to Javert to report the crime. Javert gives Marius two pistols and instructs him to fire one into the air if things get dangerous. Marius returns home and waits for Javert and the police to arrive. Thénardier sends Éponine and Azelma outside to look out for the police. When Valjean returns with rent money, Thénardier, with Patron-Minette, ambushes him and he reveals his real identity to Valjean. Marius recognizes Thénardier as the man who "saved" his father's life at Waterloo and is caught in a dilemma.
He tries to find a way to save Valjean while not betraying Thénardier. Valjean denies knowing Thénardier and tells him that they have never met. Valjean tries to escape through a window but is subdued and tied up. Thénardier orders Valjean to pay him 200,000 francs. He also orders Valjean to write a letter to Cosette to return to the apartment, and they would keep her with them until he delivers the money. After Valjean writes the letter and informs Thénardier of his address, Thénardier sends out Mme. Thénardier to get Cosette. Mme. Thénardier comes back alone, and announces the address is a fake.
It is during this time that Valjean manages to free himself. Thénardier decides to kill Valjean. While he and Patron-Minette are about to do so, Marius remembers the scrap of paper that Éponine wrote on earlier. He throws it into the Thénardiers' apartment through the wall crack. Thénardier reads it and thinks Éponine threw it inside. He, Mme. Thénardier and Patron-Minette try to escape, only to be stopped by Javert.
He arrests all the Thénardiers and Patron-Minette (except Claquesous, who escapes during his transportation to prison; Montparnasse, who stops to run off with Éponine instead of joining in on the robbery; and Gavroche, who was not present and rarely participates in his family's crimes, a notable exception being his part in breaking his father out of prison). Valjean manages to escape the scene before Javert sees him.
Volume IV – The Idyll in the Rue Plumet and the Epic in the Rue St. Denis
After Éponine's release from prison, she finds Marius at "The Field of the Lark" and sadly tells him that she found Cosette's address. She leads him to Valjean's and Cosette's house on Rue Plumet, and Marius watches the house for a few days. He and Cosette then finally meet and declare their love for one another. Thénardier, Patron-Minette and Brujon manage to escape from prison with the aid of Gavroche. One night, during one of Marius's visits with Cosette, the six men attempt to raid Valjean's and Cosette's house. However, Éponine, who has been sitting by the gates of the house, threatens to scream and awaken the whole neighbourhood if the thieves do not leave. Hearing this, they reluctantly retire. Meanwhile, Cosette informs Marius that she and Valjean will be leaving for England in a week's time, which greatly troubles the pair.
The next day, Valjean is sitting in the Champ de Mars. He is feeling troubled about seeing Thénardier in the neighbourhood several times. Unexpectedly, a note lands in his lap, which says "Move Out." He sees a figure running away in the dim light. He goes back to his house, tells Cosette they will be staying at their other house on Rue de l'Homme Arme, and reconfirms to her that they will be moving to England. Marius tries to get permission from M. Gillenormand to marry Cosette. His grandfather seems stern and angry, but has been longing for Marius's return. When tempers flare, he refuses his assent to the marriage, telling Marius to make Cosette his mistress instead. Insulted, Marius leaves.
The following day, the students revolt and erect barricades in the narrow streets of Paris. Gavroche spots Javert and informs Enjolras that Javert is a spy. When Enjolras confronts him about this, he admits his identity and his orders to spy on the students. Enjolras and the other students tie him up to a pole in the Corinth restaurant. Later that evening, Marius goes back to Valjean's and Cosette's house on Rue Plumet, but finds the house no longer occupied. He then hears a voice telling him that his friends are waiting for him at the barricade. Distraught to find Cosette gone, he heeds the voice and goes.
When Marius arrives at the barricade, the "revolution" has already started. When he stoops down to pick up a powder keg, a soldier comes up to shoot Marius. However, a man covers the muzzle of the soldier's gun with his hand. The soldier fires, fatally shooting the man, while missing Marius. Meanwhile, the soldiers are closing in. Marius climbs to the top of the barricade, holding a torch in one hand, a powder keg in the other, and threatens to the soldiers that he will blow up the barricade. After confirming this, the soldiers retreat from the barricade.
Marius decides to go to the smaller barricade, which he finds empty. As he turns back, the man who took the fatal shot for Marius earlier calls Marius by his name. Marius discovers this man is Éponine, dressed in men's clothes. As she lies dying on his knees, she confesses that she was the one who told him to go to the barricade, hoping they would die together. She also confesses to saving his life because she wanted to die before he did.
The author also states to the reader that Éponine anonymously threw the note to Valjean. Éponine then tells Marius that she has a letter for him. She also confesses to have obtained the letter the day before, originally not planning to give it to him, but decides to do so in fear he would be angry at her about it in the afterlife. After Marius takes the letter, Éponine then asks him to kiss her on the forehead when she is dead, which he promises to do. With her last breath, she confesses that she was "a little bit in love" with him, and dies.
Marius fulfills her request and goes into a tavern to read the letter. It is written by Cosette. He learns Cosette's whereabouts and he writes a farewell letter to her. He sends Gavroche to deliver it to her, but Gavroche leaves it with Valjean. Valjean, learning that Cosette's lover is fighting, is at first relieved, but an hour later, he puts on a National Guard uniform, arms himself with a gun and ammunition, and leaves his home.
Volume V – Jean Valjean
Valjean arrives at the barricade and immediately saves a man's life. He is still not certain if he wants to protect Marius or kill him. Marius recognizes Valjean at first sight. Enjolras announces that they are almost out of cartridges. When Gavroche goes outside the barricade to collect more ammunition from the dead National Guardsmen, he is shot by the troops.
Valjean volunteers to execute Javert himself, and Enjolras grants permission. Valjean takes Javert out of sight, and then shoots into the air while letting him go. Marius mistakenly believes that Valjean has killed Javert. As the barricade falls, Valjean carries off the injured and unconscious Marius. All the other students are killed. Valjean escapes through the sewers, carrying Marius's body. He evades a police patrol, and reaches an exit gate but finds it locked. Thénardier emerges from the darkness. Valjean recognizes him, but his filthy appearance prevents Thénardier from recognizing him. Thinking Valjean a murderer lugging his victim's corpse, Thénardier offers to open the gate for money. As he searches Valjean and Marius's pockets, he surreptitiously tears off a piece of Marius's coat so he can later find out his identity. Thénardier takes the thirty francs he finds, opens the gate, and allows Valjean to leave, expecting Valjean's emergence from the sewer will distract the police who have been pursuing him.
Upon exiting, Valjean encounters Javert and requests time to return Marius to his family before surrendering to him. Javert agrees, assuming that Marius will be dead within minutes. After leaving Marius at his grandfather's house, Valjean asks to be allowed a brief visit to his own home, and Javert agrees. There, Javert tells Valjean he will wait for him in the street, but when Valjean scans the street from the landing window he finds Javert has gone. Javert walks down the street, realizing that he is caught between his strict belief in the law and the mercy Valjean has shown him. He feels he can no longer give Valjean up to the authorities but also cannot ignore his duty to the law. Unable to cope with this dilemma, Javert commits suicide by throwing himself into the Seine.
Marius slowly recovers from his injuries. As he and Cosette make wedding preparations, Valjean endows them with a fortune of nearly 600,000 francs. As their wedding party winds through Paris during Mardi Gras festivities, Valjean is spotted by Thénardier, who then orders Azelma to follow him. After the wedding, Valjean confesses to Marius that he is an ex-convict. Marius is horrified, assumes the worst about Valjean's moral character, and contrives to limit Valjean's time with Cosette. Valjean accedes to Marius' judgment and his separation from Cosette. Valjean loses the will to live and retires to his bed.
Thénardier approaches Marius in disguise, but Marius recognizes him. Thénardier attempts to blackmail Marius with what he knows of Valjean, but in doing so, he inadvertently corrects Marius's misconceptions about Valjean and reveals all of the good he has done. He tries to convince Marius that Valjean is actually a murderer, and presents the piece of coat he tore off as evidence. Stunned, Marius recognizes the fabric as part of his own coat and realizes that it was Valjean who rescued him from the barricade. Marius pulls out a fistful of notes and flings it at Thénardier's face. He then confronts Thénardier with his crimes and offers him an immense sum to depart and never return. Thénardier accepts the offer, and he and Azelma travel to America where he becomes a slave trader.
As they rush to Valjean's house, Marius tells Cosette that Valjean saved his life at the barricade. They arrive to find Valjean near death and are reconciled with him. Valjean tells Cosette her mother's story and name. He dies content and is buried beneath a blank slab in Père Lachaise Cemetery.