Eighteen-year-old Jamal Malik, an Indian Muslim from the Dharavi slum, is a contestant on the Indian version of Who Wants to Be a Millionaire?, and is one question away from the grand prize. However, before the ₹20 million(US$290,000) question, he is detained and tortured by the police, who suspect him of cheating. Through a series of flashbacks, Jamal recounts the incidents in his life that provided him with each answer.
Jamal's flashbacks begin when he is five years old. He manages to obtain the autograph of Bollywood star Amitabh Bachchan after jumping into an outhouse cesspit. Jamal's older brother Salim later sells the autograph. The incident is followed immediately by the death of the siblings' mother during the Bombay riots. As the brothers flee the riot they meet Latika, a girl from their slum. Salim is reluctant to take her in, but Jamal suggests that she could be their "third musketeer", a reference to the Alexandre Dumas novel The Three Musketeers. Although the brothers had read the novel in school, and referred to themselves as Athos and Porthos, it is revealed that they do not know the third musketeer's name. Latika ultimately joins the group despite Salim's initial refusal.
The three are found by Maman—a gangster who trains street children to become beggars. When Salim learns that Maman is blinding the children in order to make them more effective beggars, he escapes with Jamal and Latika to a departing train. The brothers successfully board the moving train, but Latika is unable to keep up. Salim grabs her hand, but purposefully lets go, leaving her to be recaptured by Maman. For the next few years, Salim and Jamal travel around on top of trains, making a living by selling goods, picking pockets, washing dishes, and pretending to be tour guides at the Taj Mahal. At Jamal's insistence, they return to Mumbai to find Latika, where they discover that she is being raised by Maman to be a prostitute. The brothers rescue her, shooting and killing Maman in the process. Salim gets a job with Javed—a rival crime lord. Back at their room, Salim orders Jamal to leave him alone with Latika. When Jamal refuses, Salim draws a gun on him and Latika persuades Jamal to leave.
Years later, Jamal, now a Chaiwala in an Indian call centre, searches the centre's database for Salim and Latika. Although he fails to find Latika, he learns that Salim is a high-ranking lieutenant in Javed's crime organization. Jamal confronts Salim, who pleads for forgiveness and offers to let Jamal stay in his luxurious apartment. Jamal lies his way into Javed's residence in order to reunite with Latika. Although he professes his love for her, she tells him to forget about her. Despite the refusal, Jamal promises that he will wait for her every day at five o'clock at the VT station. Latika attempts to meet him there, but she is captured by Javed's men, led by Salim. Jamal loses contact with Latika. In a final attempt to reach her, he decides to become a contestant on Who Wants to Be a Millionaire?, because he knows she watches the show regularly.
Jamal is extremely successful on the show, answering every question correctly. He becomes popular across India, much to the dismay of the show's host, Prem Kumar. During a break, Kumar attempts to trick Jamal by feeding him the wrong answer to the penultimate question. When the question is asked, Jamal uses his 50/50 lifeline, leaving Kumar's answer and the correct one. Jamal answers correctly, raising immediate suspicion that he is cheating.
When the episode ends, Kumar leads Jamal out of the studio and he is forced into a police van. After an initial beating, the police inspector listens to Jamal's explanation of how he knew each answer. Finding all of Jamal's stories "bizarrely plausible", the officer allows him to return to the show. At Javed's safehouse, Latika sees Jamal on the news. In an effort to make amends for his past behavior, Salim gives Latika his mobile phone and car keys. He asks her to forgive him and tells her to find Jamal. Latika is fearful and reluctant, but agrees and escapes. Salim fills a bathtub with money and sits in it, waiting for Javed and his men to realize that Latika is free.
For the final question, Jamal is asked the name of the third musketeer. He uses his "Phone-A-Friend" lifeline to call Salim, because it is the only phone number that Jamal knows. Latika answers and tells Jamal that she is safe, although she does not know the answer to the question. Relieved, Jamal arbitrarily picks the first answer, Aramis. He is correct and wins the grand prize. Javed hears Latika on the show and realizes that Salim has betrayed him. He and his men break down the bathroom door. Salim kills Javed before he is shot and killed himself. In the final scene, Jamal and Latika meet on the platform at the train station and kiss. The movie ends with a Bollywood-style musical number.