The story opens in 1898 in the New Mexico wilderness. A man named Daniel Plainview (Daniel Day-Lewis) works his silver mine. After blasting out the small mine with dynamite, Plainview falls and breaks his leg. After finding the silver ore, he drags himself out of the mine and into town to sell it. He hires a crew, including a man caring for an infant son. When the silver lode plays out, Plainview discovers oil in the mine. He designs and builds a pump and recreates himself as an oil man. The young father dies in a drilling accident, Planview adopts the young boy as his own and names him H.W. Nine years later, Plainview is a successful if still somewhat minor oil man. He has several productive wells around New Mexico and, with H.W. (Dillon Freasier), travels the state to buy the drilling rights to private property.
At a meeting with local people of an unidentified town, Plainview lectures them on his business plan: he claims he does all the work himself, only hires men he can trust to complete the work and will eliminate the need for a "contractor", a middleman of sorts that will collect more money from the community that Daniel believes should go back to the landowners themselves. He also introduces his son as his partner and claims that his business is a family-run operation. When the people begin to question him rigorously and argue loudly among themselves, Daniel turns down the offer and leaves, knowing the community is a bit too smart to be taken advantage of.
Daniel later meets with a husband and wife and draws up a contract to drill on their land. The couple are reluctant but Daniel appeals to them by talking about their children. The well comes in as a gusher some time later.
One night, a young man named Paul Sunday (Paul Dano) visits Plainview's camp. Paul sells to Plainview information about his family's ranch in Little Boston, California, which he says has an ocean of oil underneath it. Plainview and H.W. travel to the Sunday Ranch and, while pretending to hunt quail, confirm what Paul told them. That night, Plainview negotiates with the Sunday patriarch, Abel (David Willis) and Paul's twin brother, Eli (Paul Dano). The price is $10,000, which will go to the building of a new parish, the Church of the Third Revelation; Eli is a bland, uncharismatic but ambitious preacher and faith healer. Daniel agrees to pay Eli half of the money at first and will pay the rest when the derrick produces. Eli wants to pray to conclude the deal but Plainview refuses.
Plainview assembles his crew at the Sunday Ranch and builds the first derrick. He also buys almost all of the land surrounding the Sunday Ranch so he will have not only those drilling rights but also the right to build a pipeline to the ocean to circumvent the railroads and their shipping costs. Only a man named William Bandy refuses to sell. Eli wants to bless the derrick before drilling begins but Plainview rebuffs him and instead has Eli's little sister, Mary (Sydney McAllister), dedicate the new endeavor. Mary and H.W. become playmates and Plainview buys her a new dress. At dinner one night, he tells Mary in front of Abel that her father will never hit her again for refusing to pray. Eli and Plainview continue to irritate one another: Plainview resents that Eli solicits his workers to come to daily prayer services, but when a worker dies while trying to free the drill, Plainview has Eli arrange for the funeral. When meeting with Eli about the funeral at his ramshackle church, he watches Eli deliver a fiery sermon about casting out the Devil from a elderly woman with severe arthritis. After mass, Eli agrees to speak at the funeral and tells Daniel that, had he been permitted to bless the well, the accident might never have happened. Eli eventually collects enough money to build himself a larger church, naming it the Church of the Third Revelation.
A few days later, the drill finally strikes oil. The escaping gases cause an explosion. H.W., who was watching the drill from the derrick, is deafened. He becomes sullen and mistrusting. Soon Plainview has three thriving oil wells in the Little Boston area. Eli goes to Daniel and demands the $5000 that Daniel promised him and his church. Daniel immediately attacks him, slapping him and dragging him to a pool of mud, which he smears all over Eli. Daniel also mocks Eli's supposed power of faith healing, saying that Eli did nothing to restore H.W.'s hearing.
Shortly thereafter, a man named Henry (Kevin O'Connor) appears on Plainview's doorstep, claiming to be Plainview's half brother. Because he knows details about Plainview's family and hometown of Fond du Lac, Wisconsin, Plainview trusts him and takes him on as a worker. Plainview admits to Henry that he holds most people in contempt and uses them only to further his own goals. "I have a competition in me," he tells him. "I want no one else to succeed." He also admits that he can't do his work alone anymore. H.W. snoops through Henry's belongings and, jealous that Plainview has someone new in his life, attempts to burn down the house with Henry and Plainview in it. Plainview doesn't discipline H.W. but instead sends him away to a boarding school in San Francisco, callously leaving him on the train with his assistant, Fletcher, who accompanies him there.
Competitors try to buy Daniel's wells for $1 million but Plainview rejects the offer and their patronizing sympathy for H.W. When one competitor suggests Plainview should retire to take care of H.W., Plainview threatens his life. He and Henry go to the Bandy property to inquire about leasing the land to build the pipeline. After surveying the land, they swim in the ocean. When Henry doesn't seem to understand a reference about Fond du Lac, Plainview grows suspicious. That night, Plainview, brandishing a pistol, forces Henry to confess: Henry isn't his brother, but knew his brother in Kansas. When the real brother died, Henry assumed his identity and made his way to California and found Daniel. Plainview kills Henry and buries him in a shallow grave on the Bandy property. The next morning, Bandy (Hans Howes) wakes Plainview and tells him that he can lease the land if he allows himself to be baptized at the Church of the Third Revelation. When Bandy reveals that he knows Plainview killed Henry, Plainview has no choice but to agree. He is baptized after he publicly and loudly announces that he is a sinner and abandoned H.W., is violently slapped several times by Eli on the dais and is warmly embraced by the church. Eli also announces to the church that Daniel has given them $5000, the original amount he owed Eli.
H.W. returns from the boarding school and Plainview warmly greets him. H.W. now knows sign language and speaks through an interpreter. He and Mary play together, and she learns sign language too. When they are married in the late 1920s, she signs the minister's sermon and marriage rites to him. Plainview has become a drunkard, even more misanthropic and isolated than ever, living alone in a large mansion and shooting his valuables with a pistol. When H.W. announces his intention to move to Mexico and begin his own oil business, Plainview immediately becomes more despondent and reveals that H.W. was never his biological son and insultingly disowns him. Sometime later, Eli visits him in the mansion's bowling alley, finding Daniel passed out on the floor. As Plainview, like a beast, gnaws the cold steak leftover from his dinner, Eli reveals that old Bandy has died and that his grandson wants to sell the oil drilling rights to his grandfather's land in order to fund his goal of becoming a movie star -- with Eli as the broker for the deal. Plainview agrees but only if Eli will say that he is a "false prophet and God is a superstition." When Eli does so several times, Plainview reveals that, having owned all the wells around the Bandy ranch, he has already taken the oil from the Bandy property through drainage. Eli reveals that, despite a successful radio preaching career, he is broke due to bad investments. Plainview chases him around the bowling alley then bludgeons him to death with a bowling pin. When the butler comes to see what the commotion has been, Plainview announces, "I'm finished" .