Nyong'o was born in Mexico City, Mexico, to Dorothy and Peter Anyang' Nyong'o, a college professor turned politician in Kenya. It is a Luo tradition to name a child after the events of the day, so her parents gave her a Spanish name, Lupita (a diminutive of Guadalupe). She is of Luo descent on both sides of her family, and is the second of six children. Nyong'o identifies as Mexican-Kenyan. Her father is a former Minister for Medical Services in the Kenyan government. At the time of her birth, he was a visiting lecturer in political science at El Colegio de México in Mexico City, and her family had been living in Mexico for three years (returning to Kenya in 1983).
Nyong'o and her family moved back to their native Kenya when she was less than one year old, as her father was appointed a professor at the University of Nairobi. She grew up primarily in Kenya, and describes her upbringing as "middle class, suburban". At age sixteen, her parents sent her back to Mexico for seven months to learn Spanish. During those seven months, Nyong'o lived in Taxco, Guerrero, and took classes at the Universidad Nacional Autónoma de México's Learning Center for Foreigners.
Nyong'o grew up in an artistic family, where family get-togethers often included performances by the children in the family and trips to see plays. She attended Rusinga International school in Kenya and acted in school plays, with a minor role in Oliver Twist being her first play. At age 14, Nyong'o made her professional acting debut as Juliet in Romeo and Juliet in a production by the Nairobi-based repertory company Phoenix Players. While a member of the Phoenix Players, Nyong'o also performed in the plays "On The Razzle" and "There Goes The Bride". Nyong'o cites the performances of Whoopi Goldberg and Oprah Winfrey in The Color Purple with inspiring her to pursue a professional acting career.
Nyong'o later attended St. Mary's School in Nairobi, where she received an IB Diploma in 2001 before attending college in the United States. After graduating from Hampshire College with a degree in film and theatre studies, she worked as part of the production crew for many films, including Fernando Meirelles's The Constant Gardener, with Ralph Fiennes, Mira Nair's The Namesake and Salvatore Stabile's Where God Left His Shoes. She cites Fiennes as another individual who inspired her to pursue a professional acting career.
She starred in the 2008 short film East River, directed by Marc Grey and shot in Brooklyn. She returned to Kenya in 2008 and starred in the Kenyan television series Shuga, an MTV Base Africa/UNICEF drama about HIV/AIDS prevention. In 2009, she wrote, directed, and produced the documentary In My Genes, about the treatment of Kenya's albino population, which played at several film festivals and won first prize at the 2008 Five College Film Festival. Nyong'o also directed the music video The Little Things You Do by Wahu featuring Bobi Wine, which was nominated for the Best Video Award at the MTV Africa Music Awards 2009.
She subsequently enrolled for a master's degree in acting at the Yale School of Drama. At Yale she appeared in many stage productions, including Gertrude Stein's Doctor Faustus Lights the Lights, Chekhov's Uncle Vanya, and William Shakespeare's The Taming of the Shrew and The Winter's Tale. While at Yale, she won the Herschel Williams Prize "awarded to acting students with outstanding ability" during the 2011–12 academic year.
Nyong'o landed her breakthrough role when she was cast for Steve McQueen's historical drama 12 Years a Slave (2013) immediately before graduating from Yale with an MFA in 2012. The film, which met with wide critical acclaim, tells the real-life story of Solomon Northup (played by Chiwitel Ejiofor), a free born African American man who is sold into slavery in 1841. Nyong'o played the role of Patsey, a slave who works alongside Northup at a cotton plantation; her performance met with rave reviews. Ian Freer of Empire wrote that she "gives one of the most committed big-screen debuts imaginable" and critic Peter Travers added that she "is a spectacular young actress who imbues Patsey with grit and radiant grace". Nyong'o was nominated for several awards including a Golden Globe Award for Best Supporting Actress, a BAFTA Award for Best Actress in a Supporting Role and two Screen Actors Guild Awards including Best Supporting Actress, which she won. She was also awarded the Academy Award for Best Supporting Actress, becoming the sixth black actress to win the award, the first African actress to win the award, the first Kenyan actress to win an Oscar, and the first Mexican citizen to win the award. She also became the fifteenth actress to win an Oscar for a debut performance in a feature film.
She played a brief role portraying a reserve flight attendant alongside Liam Neeson and Julianne Moore in the action thriller Non-Stop (2014). As of June 2014, Nyong'o is attached to star in Star Wars Episode VII (2015). She will also produce and star in a film adaptation of the novel Americanah.