The film is an adaptation of Ned Vizzini's 2006 novel of the same name. The book was inspired by Vizzini's own brief hospitalization for depression in November 2004. In 2013, Vizzini committed suicide at the age of 32 by jumping off the roof of the building where his parents lived in Brooklyn.
Paramount and MTV Films acquired the rights to the novel in May 2006. Anna Boden and Ryan Fleck were hired to adapt the screenplay with a view to direct after. After a while, Paramount changed their mind and put the production into turnaround. Focus Features then stepped in to acquire the property, keeping Boden and Fleck on throughout.