Seventeen-year-old Hazel Grace is dying of cancer. Although a new drug has bought her an undetermined amount of time, it hasn't put her disease into remission. Tethered to an oxygen tank to help her breathe, Hazel has become rather depressed and reclusive.
Her mother forces her to attend a cancer support group, hoping that she might make a friend. Hazel loathes what she sees as the false optimism of the group, but she attends to keep her mother happy. One afternoon, she meets Augustus. He has been in remission since the doctors amputated his leg, but is attending the meeting as support for his friend Isaac, who has been told that he will soon lose another eye to cancer.
Augustus and Hazel are drawn to each other almost immediately, and Hazel visits his house after the meeting to watch a movie. Hazel, an avid reader, tells Augustus about her favorite book, An Imperial Affliction, a story about a teenage girl with cancer. Hazel relates to the book's main character, Anna, in every way. Not only does Anna have cancer, but her thoughts and philosophies are similar to Hazel's. The great draw of the book, however, is that it doesn't conclude. The story just ends.
Hazel surmises that it's to show that Anna became too ill to write, or died. But the ending has always plagued her. She wants to know what happened to the other characters in the book. Augustus promises to read the book and gives her his favorite book in return. It's a novel based on his favorite video game. Augustus and Hazel soon become close friends. Together they help their friend Isaac get through the pain of his girlfriend leaving him and the loss of his sight. After reading An Imperial Affliction, Augustus becomes obsessed with finding the author, Peter Van Houten, so they can know what happened to the other characters.
Hazel tries to keep Augustus at a safe distance because she knows she is dying. She considers herself a time bomb and doesn't want to hurt anyone when she explodes. Augustus, however, is committed to Hazel, so much so that he tracks down Van Houten through his assistant's email address. The author responds, which prompts Hazel to write him so she can ask him her questions. Van Houten responds several days later. He regrets to inform Hazel that he won't answer her questions in a letter or telephone conversation for fear she might try to write a sequel to his story. He flippantly tells her that if she is ever in Amsterdam, where he now resides, she should visit him.
Several days later, Augustus tells Hazel that he has contacted the Wish Factory, an organization that helps grant the wishes of sick children. Hazel had already been granted a wish when she was 13 and thought she was going to die, but Augustus never used his. The Wish Factory agrees to send Augustus, Hazel and a responsible adult to Amsterdam to meet Van Houten.
Before they can leave on their trip, Hazel's lungs fill with fluid, and she is rushed to the hospital. Unconscious for several days, she wakes up in the intensive care unit. Augustus has been waiting to see her, but only family is allowed into ICU. The good news out of this latest trauma is that Hazel's latest scans show no new tumor growth. She will have to use a machine at night to force more oxygen to her lungs, but other than that, the doctors are optimistic that the new drug she's on is holding off her cancer. More good news arrives when her doctors give her the OK to fly to Amsterdam.
On the first evening of their trip, Augustus and Hazel are given an exquisite dinner. The spring air is filled with floating tree blossoms, and the waiters treat them like newlyweds, even giving them champagne. Peter Van Houten, they are told, is paying the bill. The following day, the two take a cab to Van Houten's apartment, only to discover that the author didn't know of their coming and doesn't welcome their visit. His assistant, Lidewij, had set the visit up, hoping to coax her employer out of his self-imposed exile.
Van Houten is rude and obnoxious to the teenagers, refusing to answer their questions for the sheer reason that his characters aren't real. They don't continue to exist after the book is finished. Their story ended with the death of Anna. He has never imagined what happened to them later. He then belittles Hazel and Augustus, saying that they are only living because others pity them and pay for their treatments.
Augustus and Hazel leave the house angry and upset. Lidewij follows them out, after having resigned her position as Van Houten's assistant. She brings the children to Anne Frank's house and pays for their admission. The house has no elevators, so Hazel must lug her oxygen tank up a myriad of stairs. The exhaustion she suffers is worth it as she and Augustus share their first kiss at the end of the exhibit. The other tourists around them applaud.
Hazel and Augustus return to their hotel where they make love in his hotel room. After breakfast the following morning, Hazel's mother leaves the two alone to talk. Hazel and Augustus return to Hazel's room where he tells her that his cancer has returned and is attacking every part of his body. It is intimated that they again have sex.
They return home where Augustus immediately begins radical chemotherapy treatments. The drugs do little to stop his cancer, but they do make him tired and sick. Isaac visits and tells them he hasn't heard from his former girlfriend since the operation that took his sight. Angry, Augustus decides they have to retaliate. Hazel drives them to the store where she buys a dozen eggs. She then takes them over to the girlfriend's house.
Augustus coaches Isaac on where to aim the eggs and several of them manage to hit her car. After that, Augustus' health quickly declines. Hazel stays with him, even as he is mortified at how feeble he's become. As his death draws closer, he asks Hazel to meet him one night at the church where the support group meets. It is after hours and no one is there but Augustus and Isaac. Augustus wants to hear the eulogies that they will give at his funeral. After hearing them, he dies eight days later.
Hazel is shocked when Peter Van Houten attends Augustus' funeral. She and her parents give him a ride from the grave. He tells Hazel that Augustus wrote to him after they'd left Amsterdam. Because Van Houten still acts pretentious, Hazel makes him get out of the car.
Several days later, Isaac asks her if Augustus ever gave her the paper he was working on. Hazel gets in her car to drive to Augustus' house and is shocked to find Peter Van Houten in the back seat. She tries to get him to leave, but he insists on riding with her to Augustus' house. Along the way, he tells Hazel about his daughter who died at age 8 of cancer.
Hazel realizes that his daughter's death was the reason he became a miserable alcoholic. She eventually leaves him on the side of the road. Hazel scours Augustus' computer, room and house, but can't find anything that he wrote. She eventually figures out that he must have sent something to Van Houten. She writes Lidewij to ask if she saw anything. Lidewij responds the following afternoon after visiting the returned Van Houten and obtaining Augustus' letter.
It is a eulogy for Hazel. Augustus asked Van Houten to take his words and turn them into a worthy essay for Hazel. Van Houten told Lidewij that he could add nothing to Augustus' words. The story ends with Hazel reading Augustus' letter. In it, he speaks of his love for her and the way she lived her life.