Hazel Grace Lancaster, a 16-year-old with thyroid cancer that has spread to her lungs, attends a cancer patient support group at her mother's behest. At one meeting, Hazel meets a 17-year-old boy currently in remission named Augustus Waters, whose Osteosarcoma caused him to lose his right leg. Augustus is at the meeting to support Isaac, his friend who has eye cancer. They meet after the support group and begin to talk. When everything seems to be going well, Augustus pulls out a cigarette and puts it between his lips. Hazel is disgusted by this and yells at him saying that he's already got cancer and he wants to pay money for more cancer, Augustus explains that he does not actually light the cigarette. Hazel, impressed by this, goes to his house to watch a movie. Hazel and Augustus strike a bond immediately and agree to read each other's favorite novels. Augustus gives Hazel The Price of Dawn, and Hazel recommends An Imperial Affliction, a novel written by Peter Van Houten, who lives in Amsterdam, about a cancer-stricken girl named Anna that parallels Hazel's own experience. After Augustus finishes reading her book, he is frustrated upon learning that the novel ends abruptly without a conclusion. The novel ends in the middle of a sentence, which means she either died or became too sick to continue telling the story. Hazel explains the novel's author had retreated following the novel's publication and has not been heard from since.
A week later, Augustus reveals to Hazel that he has tracked down Van Houten's assistant, Lidewij, and, through her, has managed to start an e-mail correspondence with Van Houten. The two write to Van Houten with questions regarding the novel's ending and the fate of the mother of Anna. Van Houten eventually replies, explaining that he can only answer Hazel's questions in person. At a picnic, Augustus surprises Hazel with tickets to Amsterdam to meet Van Houten.
While on the plane to Amsterdam, Augustus confesses his love for Hazel. Hazel and Augustus finally meet Van Houten but are shocked to find that he is a mean-spirited drunk. Horrified by Van Houten's behavior, Lidewij confesses to having arranged the meeting on his behalf, angering Van Houten, who proceeds to insult Hazel's cancer, starting an argument and causing Hazel and Augustus to flee from his home. Then, they go to the Anne Frank House, where Augustus and Hazel share their first kiss. Later that night they have sex in Augustus's hotel room, the first time for both of them. During their intimacy, Hazel tells Augustus she loves him.
Augustus confesses to Hazel that his cancer has returned. The two affirm their love and support for one another. Upon their return to Indianapolis, Augustus's health worsens and he ends up in the ICU for a few days. Fearing his death, Augustus invites Isaac and Hazel to his pre-funeral, where they give eulogies. Augustus dies soon after, leaving Hazel heartbroken. Van Houten shows up at Augustus's funeral to apologize to Hazel, but Hazel does not forgive him.
Hazel learns that Augustus was not writing a sequel to An Imperial Affliction like he told her, but an orbituary for her, and reads it after lidewij discovers it amidst Van Houten’s letters. It states that getting hurt in this world is inevitable, but we do get to choose whom we allow to hurt us, and that he is happy with his choice, and hopes she likes hers too. The book closes with Hazel stating that she is happy with her choice.