Quentin “Q” Jacobsen (Wolff) lives across the street to Margo Roth Spiegelman (Delevingne) in a subdivision, Jefferson Park, at 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 (Lane Lovegrove), 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. In contrast, Quentin is kind and unassertive, but unpopular among his peers. His friends are other outcasts, Benjamin “Ben” Starling (Austin Abrams), and Marcus “Radar” Lincoln (Justice Smith).
One night, Margo climbs through Quentin’s window and recruits him for an all-night, revenge road trip. Margo discovers that her boyfriend, Jason “Jase” Worthington (Griffin Freeman), was unfaithful with one of her friends, Rebecca “Becca” Arrington (Caitlin Carver). After buying supplies, they pull humiliating pranks on Jason and Rebecca, and their friends, including Margo’s best friend, Lacey Pemberton (Halston Sage). Margo accuses Lacey of not telling her about the affair. (It is revealed later that Lacey was unaware of the affair 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. Margo’s parents will not report her missing to the police since 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 (Meg Crosbie) 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 Lacey 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 (Jaz Sinclair), begin a two-day road trip to find Margo, hoping to be home in time for their prom after they find her. They bond on the way, as Benjamin and Lacey are going 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 Margo on the street and admits his affection for her, but she does not feel the same way. She ran away from home to escape her dysfunctional family life, to 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, Margo 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.