The film is based on the science-fiction novel "Z for Zachariah" by Robert C. O'Brien, which was published posthumously in 1974. The film's "love triangle" is a major deviation because there are only two protagonists - Ann and Loomis - in the novel.
Although set in the Appalachian Mountains of the Eastern United States of America, the film was shot entirely in New Zealand's Banks Peninsula. The two areas share a similar geography.
In the movie, Ann's age is never specified, though Caleb (Chris Pine) remarks to Loomis (Chiwetel Ejiofor) that she seems older than her chronological age. In Robert C. O'Brien's source novel, Ann is only sixteen years old.
Amanda Seyfried was cast in the lead role but after the production was delayed, Seyfried had to drop out due to scheduling conflicts. Margot Robbie replaced her.
After leaving the filming wrap party in Methven, New Zealand, Chris Pine was pulled over by police and charged with drunk driving. He pleaded guilty and was disqualified from driving for six months and ordered to pay $93 in reparation. He was let off with a fine after making a sizable donation to charity.