Hazel Grace Lancaster—a 16-year-old with cancer that has spread to her lungs—attends a cancer patient support group at her mother's behest. At first, she hesitates because she feels like it has done nothing for her. She thinks attending the support group could be the worst part of her life, until at one particular support meeting, Hazel meets a 17-year-old boy named Augustus Waters, whose osteosarcoma caused him to lose his right leg, which was replaced with a prosthetic. Augustus is at the support meeting to support Isaac, a boy Augustus' age with eye cancer. Upon catching Augustus staring at her, Hazel suddenly feels self conscious. They meet after the support group and converse on the fact that they were not "literally" in the heart of Jesus, but in a basement. When everything seems to go 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, "Not being able to breathe sucks," she yells. Augustus calmly explains the metaphor, which is, "You put the thing that kills you right between your teeth but you don't give it the power to kill you." Hazel, impressed by this, goes to his place to watch a movie. Hazel and Augustus strike a bond immediately and agree to read each other's favorite novels. Augustus gives Hazel The Prince 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. 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 in 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 the drunken author's home. Later that night they have sex in Augustus's hotel room, the first time for both of them.
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. An extremely sick Augustus dies soon after. This leaves Hazel heartbroken and she doesn't know what to do with herself. After this traumatic event, Van Houten shows up at Augustus's funeral to apologize to Hazel.
Hazel learns that Augustus was writing a sequel to An Imperial Affliction. Hazel reads Augustus's words. He says 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 her choice too. The book closes with Hazel stating that she is happy with her choice.