In 1841, Solomon Northup (Chiwetel Ejiofor) is a free African-American man working as a violinist, who lives with his wife and two children in Saratoga Springs, New York. Two men (Scoot McNairy and Taran Killam) offer him a two-week job as a musician if he will travel to Washington, D.C. with them, but once they get there they drug Northup and he wakes up in chains, about to be sold into slavery.
Northup is shipped to New Orleans and is renamed "Platt", the identity of a runaway slave from Georgia. Beaten repeatedly, he is ultimately purchased by plantation owner William Ford (Benedict Cumberbatch). Northup manages to stay on good terms with Ford, a relatively benevolent master. Northup engineers a waterway for transporting logs swiftly and cost-effectively across a swamp, and Ford presents him with a violin in gratitude. Overseer John Tibeats (Paul Dano) resents Northup and begins verbally harassing him.
The tensions between Tibeats and Northup escalate; Tibeats attacks Northup, and Northup fights back. In retaliation, Tibeats and his friends attempt to lynch Northup, who suffers many hours standing on tiptoe while in the noose. Ford explains that in order to save Northup's life he must be sold to Edwin Epps (Michael Fassbender). Northup attempts to reason with Ford, explaining that he is actually a free man. Ford states that he "cannot hear this" and responds "he has a debt to pay" on Northup's purchase price.
Epps believes his right to abuse his slaves is biblically sanctioned. The slaves must pick at least 200 pounds (91 kg) of cotton every day, or be beaten. A young female slave named Patsey (Lupita Nyong'o) picks over 500 pounds (230 kg) daily, and is praised lavishly by Epps. He also repeatedly rapes her, and seems to fall in love with her against his better judgement. Epps' wife (Sarah Paulson) is envious of Patsey and frequently humiliates and attacks her.
The abuse of Patsey worsens as Epps continues to rape her. Patsey wishes to die and asks Northup to kill her; he refuses. Sometime later, an outbreak of cotton worm befalls Epps' plantation; he decides that the new slaves are the cause, a plague sent by God. He leases them to a neighboring plantation for the season. While there, Northup gains the favor of the plantation's owner, who allows him to play the fiddle at a neighbor's wedding anniversary celebration, and to keep his earnings.
When Northup returns to Epps, he attempts to use the money to pay a white field hand and former over-seer, Armsby (Garret Dillahunt), to mail a letter to Northup's friends in New York. Armsby agrees to deliver the letter, and accepts all Northup's saved money. Northup is betrayed by Armsby, and Northup is narrowly able to convince Epps that the story of a letter is a lie. Northup tearfully burns the letter, his only hope of freedom.
Northup begins working on the construction of a gazebo with a Canadian laborer named Bass (Brad Pitt). Bass earns Epps' displeasure by expressing his opposition to slavery, by trying to explain to Epps that he could have a little compassion towards those working for him. Epps sees them as his property.
One day, Epps becomes enraged after discovering Patsey missing from his plantation. When she returns, she reveals she was gone to get a bar of soap from Mistress Shaw (Alfre Woodard), having become sick from her own stench as a result of being forbidden soap by Mary Epps. Epps doesn't believe her and orders her stripped and tied to a post. Encouraged by his wife, Epps forces Northup to whip Patsey. Northup reluctantly obeys, but Epps eventually takes the whip away from Northup, savagely lashing her.
Northup purposely destroys his violin, and while continuing to work on the gazebo, he asks Bass where he's from. Bass replies that he is from Canada. Northup confides his kidnapping to Bass. Once again, Northup asks for help in getting a letter to Saratoga Springs. Bass, risking his life, agrees to send it.
One day, Northup is called over by the local sheriff, who arrives in a carriage with another man. The sheriff asks Northup a series of questions to confirm his answers match the facts of his life in New York. Northup recognizes the sheriff's companion as a shopkeeper he knows from Saratoga. The man has come to free him, and the two embrace. Though Epps angrily resists and Patsey is distraught, Northup leaves immediately.
After being enslaved for twelve years, Northup is restored to freedom and returned to his family. As he walks into his home, he sees his whole family, including his daughter, who presents him with his grandson and namesake. Concluding credits recount the inability of Northup and his legal counsel to prosecute the men responsible for him being sold into slavery as well as the mystery surrounding details of Northup's death and burial.