In October 2003, 19-year-old Harvard University student Mark Zuckerberg is dumped by his girlfriend Erica Albright. Returning to his dorm, Zuckerberg writes an insulting entry about Albright on his LiveJournal blog and then creates a campus website called Facemash by hacking into college databases to steal photos of female students, then allowing site visitors to rate their attractiveness. After traffic to the site crashes parts of Harvard's computer network, Zuckerberg is given six months of academic probation. However, Facemash's popularity attracts the attention of Harvard upperclassmen and twins Cameron and Tyler Winklevoss and their business partner Divya Narendra. The trio invites Zuckerberg to work on Harvard Connection, a social network featuring the exclusive nature of Harvard students and aimed at dating.
After agreeing to work on the Winklevoss twins' concept, Zuckerberg approaches his friend Eduardo Saverin with an idea for what he calls Thefacebook, an online social networking website that would be exclusive to Ivy League students. Saverin provides $1,000 in seed funding, allowing Mark to build the website, which quickly becomes popular. When they learn of Thefacebook, the Winklevoss twins and Narendra are incensed, believing that Zuckerberg stole their idea while keeping them deliberately in the dark by stalling on developing the Harvard Connection website. They raise their complaint with Harvard President Larry Summers, who is dismissive and sees no value in either disciplinary action or Thefacebook website itself.
Saverin and Zuckerberg meet fellow student Christy Lee, who asks them to "Facebook me", a phrase which impresses both of them. As Thefacebook grows in popularity, Zuckerberg extends the network to Yale University, Columbia University and Stanford University. Lee arranges for Saverin and Zuckerberg to meet Napster co-founder Sean Parker, who presents a "billion-dollar" vision for the company that impresses Zuckerberg. He also suggests dropping "The" from Thefacebook, just calling it Facebook. At Parker's suggestion, the company moves to Palo Alto, with Saverin remaining in New York to work on business development. After Parker promises to expand Facebook to two continents, Zuckerberg invites him to live at the house he is using as company headquarters.
While competing in the Henley Royal Regatta for Harvard against the Hollandia Roeiclub, the Winklevoss twins discover that Facebook has expanded to Oxford, Cambridge and LSE, and decide to sue the company for theft of intellectual property. Meanwhile, Saverin objects to Parker making business decisions for Facebook and freezes the company's bank account in the resulting dispute. He later relents when Zuckerberg reveals that they have secured $500,000 from angel investor Peter Thiel. However, Saverin becomes enraged when he discovers that the new investment deal allows his share of Facebook to be diluted from 34% to 0.03%, while maintaining the ownership percentage of all other parties. He confronts Zuckerberg and Parker, and Saverin vows to sue Zuckerberg for all the company's shares before being ejected from the building. Subsequently, Saverin's name is removed from the masthead as co-founder. Later, a cocaine possession incident involving Parker and his attempt to place the blame on Saverin finally convinces Zuckerberg to cut ties with him.
Throughout the film, the narrative is intercut with scenes from depositions taken in the Winklevoss twins' and Saverin's respective lawsuits against Zuckerberg and Facebook. The Winklevoss twins claim that Zuckerberg stole their idea, while Saverin claims his shares of Facebook were unfairly diluted when the company was incorporated. At the end, Marylin Delpy, a junior lawyer for the defense, informs Zuckerberg that they will settle with Saverin, since the sordid details of Facebook's founding and Zuckerberg's own callous attitude will make him highly unsympathetic to a jury. After everyone leaves, Zuckerberg is shown sending a friend request to Albright on Facebook and then refreshing the webpage every few seconds as he waits for her response.
The epilogue states that Cameron and Tyler Winklevoss received a settlement of $65 million, signed a non-disclosure agreement, and rowed in the 2008 Beijing Olympics, placing sixth; Eduardo Saverin received a settlement of an unknown amount and his name was restored to the Facebook masthead as a co-founder; the website has over 500 million members in 207 countries and is valued at $25 billion; and Mark Zuckerberg is the world's youngest self-made billionaire.