In October 2003, Harvard University student Mark Zuckerberg (Jesse Eisenberg
) has the idea to create a website to rate the attractiveness of female Harvard undergraduates after his girlfriend Erica Albright (Rooney Mara
) breaks up with him. Over the course of a single night, Mark hacks into the databases of various residence halls, downloads pictures and names of female students and, using an algorithm for ranking chess players supplied by his best friend Eduardo Saverin (Andrew Garfield
), he creates in a few hours a website called "FaceMash.com", where male students can interactively choose which of two girls presented at a time is more attractive.
Mark is punished with six months of academic probation after the traffic to the site brings down parts of Harvard's computer network, and he becomes vilified among most of Harvard's female community. However, the popularity of "FaceMash" and the fact that he created it in one night, while drunk, brings him to the attention of Cameron Winklevoss and Tyler Winklevoss (Armie Hammer
and Josh Pence
), identical twins and members of Harvard's rowing team, and their business partner Divya Narendra (Max Minghella
). As a result, he gains a job working for the Winklevoss twins as the programmer of their website, Harvard Connection.
Soon afterwards, Mark approaches his friend Eduardo and tells him of his idea for what he calls "Thefacebook", an online social networking website exclusive to Harvard University students. He explains this would let people share personal and social information securely. Eduardo agrees to help Mark, providing a fee of $1,000 to help start the site. Once complete, they distribute the link to Eduardo's connections at the Phoenix S-K final club, and it quickly becomes popular throughout the student body. When they learn of Thefacebook, the Winklevoss twins and Narendar believe that Zuckerberg stole their idea while simultaneously stalling on their website. Cameron and Divya want to sue Mark for intellectual property theft, but Tyler convinces them they can settle the matter as "Harvard gentlemen" without resorting to the courts.
A few months later, at a lecture by Bill Gates (Steve Sires
), fellow Harvard University student Christy Lee (Brenda Song
) introduces herself and her friend Alice (Malese Jow
) to Eduardo and Mark. She asks that the boys "Facebook us", which impresses both of them. The girls invite them to a bar, where they have sex in the toilet. Mark later runs into his ex-girlfriend, Erica, who is not aware of The Facebook's existence because she is not a Harvard University student. Stung by this, Mark decides to expand the site to more schools. Christy, Mark, and Eduardo later return to Mark's room where they outline the structure of the company and their plan for moving forward.
By the spring of 2004, the Facebook grows in popularity, and it expands to other schools in the Northeastern United States, while the Winklevoss twins and Narendra become angrier at seeing "their idea" advance without them. Tyler refuses to sue them, instead accusing Mark of violating the Harvard student Code of Conduct. Through their father's connections they arrange a meeting with Harvard President Larry Summers (Douglas Urbanski
), who is dismissive and sees no potential value in either a disciplinary action or in a lawsuit against Thefacebook website itself.
Through Christy Lee, now Eduardo's girlfriend, Eduardo and Mark arrange a meeting with Napster co-founder Sean Parker (Justin Timberlake
). When Christy, Mark and Eduardo meet Parker at a trendy Fusion restaruant in New York City, Eduardo becomes skeptical of the eccentric Parker, noting his problematic personal and professional history. Mark, however, is impressed with Parker since he presented a similar vision of Facebook. Although no deals are reached, Parker suggests that they drop "The" from Thefacebook to make it simply "Facebook".
That summer, Mark moves the company's base of operation to Palo Alto, California at Parker's suggestion, while Eduardo remains in New York for seeking advertising support. When Eduardo visits from New York, he is angered to find that Parker is living at the house and making business decisions for Facebook. After an argument with Mark, the vindictive Eduardo freezes the company's bank account and returns to New York. Upon returning, Christy and Eduardo argue about his Facebook profile, which still lists him as "single". Christy accuses Eduardo of cheating on her and sets fire to a scarf he gave to her as a gift. While Eduardo extinguishes the fire, Mark angrily calls him on the phone about freezing the Facebook bank accounts, and reveals that they have secured money from "an angel investor" through Parker's contacts. As a result of Christy's jealousy, Eduardo ends his relationship with her.
Meanwhile in England, while competing in the Henley Royal Regatta, the Winklevoss twins become outraged that Facebook has expanded to a number of universities there and they finally decide to sue Mark. Eduardo has also discovered the deal he signed with Parker's investors allows them to dilute his share of the company from a third to less than one tenth of one percent, while maintaining the ownership percentage of all other parties. He confronts his erstwhile friend Mark at his new Facebook office in downtown L.A. and announces his intention to sue him.
Later that night, Parker, along with a number of Facebook interns, is arrested for possession of cocaine during a party thrown on the occasion of Facebook's 1 millionth member. It is strongly implied (but never fully explained) that Mark had anonymously tipped off the police to raid the frat house where the party was held and probably had someone plant drugs at the party to intentionally have Parker and his interns arrested to remove them from the Facebook company.
In the final scene, a junior lawyer for the defense informs Mark they will be settling with Eduardo, since the sordid details of Facebook's founding and Mark's cynical personality will make a jury highly unsympathetic to him. The film ends with Mark sending a friend request to his former girlfriend Erica on Facebook, and refreshing the page every few seconds waiting for a response that never comes.