Quentin "Q" Jacobsen lives across the street from Margo Roth Spiegelman in Jefferson Park, a subdivision of Orlando, Florida. She is a childhood friend from whom he has drifted over nine years after they discovered the corpse of a local lawyer, Robert Joyner, who killed himself after his divorce. Unbeknownst to Margo, Quentin has been infatuated with her since they became neighbors.
After reaching adolescence, Margo becomes one of the popular girls, with an adventurous reputation, at Jefferson Park High School.[a] In contrast, Quentin is kind and unassertive, but unpopular among his peers. His friends are other outcasts, Benjamin "Ben" Starling, and Marcus "Radar" Lincoln.
One night, Margo climbs through Quentin's window and recruits him for an all-night, revenge adventure. She had discovered that her boyfriend, Jason "Jase" Worthington, was unfaithful (having sex) with one of her friends, Rebecca "Becca" Arrington. After buying supplies, they pull humiliating pranks on Jason and Rebecca, and their friends, including Margo's best friend, Lacey Pemberton.
Margo believes Lacey had not told her about the affair. (It is revealed later that Lacey was unaware of it until she was pranked). The event gives Quentin hope that he finally has a chance to develop a closer relationship with Margo. He begins to learn how to assert himself and to take chances.
The next day Margo does not come to school, and after a few days, some consider her missing, others just conclude she left for an undisclosed location. Her parents will not report her missing to the police as she has run away from home repeatedly before, and they believe their daughter will return eventually.
After seeing a recently attached Woody Guthrie poster on her bedroom wall, Quentin realizes that Margo deliberately left clues for him as to where she would be going. Benjamin and Marcus start searching for other clues in hopes of finding Margo so that Quentin can confess his feelings to her. Quentin bribes Margo's sister Ruthie so that they can look for the clues to Margo's whereabouts in her room.
When Quentin, Benjamin, and Marcus attend a party at Jason's house, Lacey argues with Rebecca over her betrayal of Margo with Jason. Because of her loyalty to Margo and her revulsion towards Rebecca and Jason's promiscuity, Lacey leaves in disgust. Quentin finds her in a bathroom and gets to know her, discovering that, beneath her superficial exterior, she is an intelligent and compassionate person, and they become friends.
After finding more clues, Quentin starts to put them together and is led with his friends to an old gift store at an abandoned strip mall. They find a map that Margo used, and discover that she has been hiding in Agloe, a paper town located in the State of New York. Quentin and his friends, including Marcus's girlfriend Angela, begin a two-day road trip to find Margo, planning to be home in time for their prom after they find her. They bond on the way, as Benjamin and Lacey decide to the prom together; Marcus and Angela consummate their relationship.
When they do not find Margo where they expect her to be, Quentin stays while the others return home with his car. He finds her on the street and admits his affection for her, but she does not feel the same way. Margo ran away from home to escape her dysfunctional family life and figure out who she is. She left the clues to let Quentin know that she is safe, not to invite him to follow her.
Margo remains in Agloe. Quentin books a bus ticket home, and they share a farewell kiss. Before he leaves, she tells him that she has been in contact with Ruthie since leaving Orlando. Returning to Orlando, Quentin enjoys the company of his friends at the prom. After graduation, he continues spending time with them throughout the summer before they all leave for college.
Nat Wolff as Quentin "Q" Jacobsen, the film's lead protagonist
Josiah Cerio as young "Q"
Cara Delevingne as Margo Roth Spiegelman, Quentin's childhood friend and the object of his affection
Hannah Alligood as young Margo
Halston Sage as Lacey Pemberton, Margo's best friend, she later becomes one of Quentin's friends and Benjamin's prom date
Austin Abrams as Benjamin "Ben" Starling, one of Quentin's best friends
Kendall McIntyre as young Ben
Justice Smith as Marcus "Radar" Lincoln, one of Quentin's best friends
Jaz Sinclair as Angela, Marcus's girlfriend, and prom date, who later joins Quentin's circle of friends
Cara Buono as Connie Jacobsen, Quentin's mother
Griffin Freeman as Jason "Jase" Worthington, Margo's former boyfriend and Quentin's nemesis
Caitlin Carver as Rebecca "Becca" Arrington, Margo's former friend-turned-nemesis and Jason's new girlfriend
Meg Crosbie as Ruthie Spiegelman, Margo's sister
Susan Macke Miller as Debbie Spiegelman, Margo and Ruthie's mother
Tom Hillmann as Josh Spiegelman, Margo and Ruthie's father
RJ Shearer as Chuck Parson, Jason's best friend, Lacey's former boyfriend, and Quentin's nemesis
Jim Coleman as Detective Otis Warren with the Orlando Police Department
Lane Lovegrove as Robert Joyner, the local man whose corpse was found by Margo and Quentin after he committed suicide
Ansel Elgort (cameo) as Mason, the convenience store clerk who is infatuated with Lacey
Stevie Ray Dallimore as Hank Jacobsen, Quentin's father
John Green (voice) as Dwight Arrington, Rebecca's father
based on the 2008 novel of the same name by John Green.