[This version is a close adaptation of the Broadway stage musical with the dialogue entirely in song]
In 1815 France, convict Jean Valjean (Hugh Jackman) is released on parole by prison guard Javert (Russell Crowe) after serving a 19-year sentence for stealing a loaf of bread as well as repeated escape attempts. After several months of drifting around France, Valjean is offered food and shelter by the Bishop of Digne (Colm Wilkinson), but steals his silver during the night. He is caught by the authorities, but the Bishop lies by saying that the silver was given as a gift, and secures Valjean's release. Touched by the Bishop's love, grace and generosity, Valjean breaks his parole and vows to start an honest life under a new identity. Javert swears he will bring the escaped convict to justice.
Eight years later in 1823, Valjean has become a wealthy factory owner and mayor of the small town of Montreuil-sur-Mer. A young woman named Fantine (Anne Hathaway), one of his workers, is discovered to be sending money to her illegitimate daughter, Cosette (Isabelle Allen), who lives with the unscrupulous Thénardiers (Sacha Baron Cohen and Helena Bonham Carter) and their daughter Éponine (Natalya Angel Wallace), and is dismissed by the foreman (Michael Jibson). Left with no alternative, Fantine turns to prostitution. During an argument with an abusive customer, Javert, now a police inspector, arrests Fantine, but Valjean intercedes and takes her to a hospital where she is diagnosed with a terminal case of tuberclosis.
Later, Valjean learns that a man believed to be him has been arrested. Unable to condemn an innocent man, Valjean reveals his identity to the court before departing for the hospital. There he promises to a dying Fantine that he will look after her daughter. After Fantine dies, Javert arrives at the hospital and attempts to arrest Valjean. But Valjean escapes and finds Cosette at the Thénardiers brothel/halfway house. Valjean bribes the couple to allow him to take Cosette away. After Valjean confides in Cosette about her mother passing away, he promises to be like a father to her. Valjean makes contact with the Bishop of Digne who agrees to give him and Cosette new idenities to hide from the authorities.
Nine years later in June of 1833, Jean Maximilien Lamarque, the only government official sympathetic toward the poor, is nearing death. Students Marius Pontmercy (Eddie Redmayne) and Enjolras (Aaron Tveit), together with street urchin Gavroche (Daniel Huttlestone), discuss fomenting a revolution to overthrow the government. Later Marius catches a glimpse of Cosette (Amanda Seyfried), now a young woman, and instantly falls in love with her. Meanwhile, despite Cosette's questioning, Valjean refuses to tell her about his past or anything about her late mother, Fantine.
At a café, Enjolras organises a group of idealistic students as Lamarque's death is announced. Meanwhile, Éponine (Samantha Barks), now Marius's friend, leads him to Cosette, where the two profess their love for one another. Lamenting that her secret love for Marius will never be reciprocated, Éponine fatalistically decides to join the revolution. Later, an attempted robbery of Valjean's house makes him mistakenly believe that Javert has discovered him, and he flees with Cosette. As they leave, Enjolras rallies the Parisians to revolt, and Cosette sends a farewell letter to Marius.
The next day, the students interrupt Lamarque's funeral procession and begin their assault. Javert poses as a rebel in order to spy on them, but is quickly exposed by Gavroche and captured. During the ensuing gunfight, Éponine saves Marius at the cost of her own life, professing her love to him before she dies, which leaves Marius devastated at the loss of his best friend. Valjean, intercepting a letter from Marius to Cosette, goes to the barricade to protect Marius. After saving Enjolras from snipers, he is allowed to execute Javert. However, when the two are alone, Valjean chooses to free Javert instead and fires his gun to fake the execution. Initially disbelieving, Javert wonders at Valjean's generosity.
With the majority of the Parisians not joining the revolution as the students expected, they resolve to fight to the death. Everyone is killed by government troops in the final assault on the street barricades, but Marius is saved when Valjean drags his unconscious body into the sewers. Thénardier, scavenging the dead bodies, steals Marius's ring. Valjean recovers and escapes the sewers carrying Marius, but is confronted at the exit by Javert. Javert threatens to shoot Valjean if he refuses to surrender, but Valjean ignores him. Unable to reconcile the conflict between his civil and moral duties, two things which he always considered the same, Javert commits suicide by jumping off a bridge into the Seine river.
Later, Marius mourns for his friends but Cosette comforts him. Revealing his past to Marius, Valjean tells him he must leave because his presence endangers Cosette, and makes Marius promise never to tell her. A few months later, Marius and Cosette marry; the Thénardiers crash the reception and testify that they saw Valjean carrying a murdered corpse through the sewers. Thénardier unwittingly shows Marius the ring that he stole from him as "proof." Recognising the ring, Marius realises that it was Valjean who saved his life. Marius and Cosette rush to Valjean after being told his location by Thénardier.
As Valjean sits dying in a local convent from his long-term heart condition, he perceives the spirit of Fantine appearing to take him to Heaven. Cosette and Marius rush in to bid farewell. Valjean hands Cosette his confession of his past life, and the spirits of Fantine and the Bishop guide him to paradise, where he joins the spirits of Enjolras, Éponine, Gavroche, and the other rebels at the Barricade on the rue Soufflot.