Donnie Darko (Jake Gyllenhall) is a troubled teenager in suburban Maryland. A schizophrenic with a history of violence, he has recently stopped taking his medication and as a result is sleepwalking. His parents, Rose and Eddie (Mary McDonnell and Holmes Osborne) and his sisters, Elizabeth and Samantha (Maggie Gyllenhall and Daveigh Chase), worry about him. One night at dinner, Donnie and his sister get into a profane argument during which Elizabeth reveals she knows Donnie is no longer taking his medication. Rose confronts Donnie in his bedroom and he calls her a bitch. Guilty, Donnie resumes taking his medication. On October 2nd, however, he sleepwalks and meets Frank, a man in a menacing bunny costume. Frank tells him that in 28 days, 6 hours, 42 minutes and12 seconds, the world will end. That night, a jet engine mysteriously crashes through the roof of the Darkos' house, destroying Donnie's room. Had he not been sleepwalking, he would have been killed.
On the way to the office of Dr. Thurman (Katherine Ross), Donnie's therapist, Donnie and Eddie nearly run over Roberta Sparrow, also known as "Grandma Death" (Patience Cleveland). A senile old woman who spends her days walking back and forth from her house to the mailbox across the street, Grandma Death whispers in Donnie's ear that all that lives ultimately dies alone. This greatly troubles Donnie, who worries that life has no meaning.
A few days later, Frank appears to Donnie in a hallucination and encourages him to flood the private high school he attends by breaking open the water main with an ax. Donnie also embeds the ax in the head of the school's solid bronze statue of its mascot and spraypaints "They made me do it" on the sidewalk. School is canceled that day and Donnie walks home Gretchen (Jena Malone), the new girl in school. She reveals that her stepfather nearly killed her mother and is still on the loose. Donnie reveals his own troubled past as well as his intelligence. Gretchen decides that Donnie is weird and that this makes him attractive. They agree to become a couple.
Donnie has a troubled relationship with the faculty at his high school. Ms. Pomeroy (Drew Barrymore) appreciates his intellect and ability to engage with and understand the difficult material she assigns them to read in English class. The science teacher, Mr. Monnitoff (Noah Wyle), finds him a little more troubling, and Kitty Farmer (Beth Grant), the high strung and socially conservative health instructor, is offended that he questions her use of self-help tapes in class. After he profanely rejects her use of the simplistic methods espoused by local celebrity Jim Cunningham (Patrick Swayze), Donnie finds himself suspended from afterschool activities. When Donnie verbally assaults Cunningham during an appearance at the high school, he gets in even deeper trouble. Although the administration suspects that Donnie is indeed responsible for the vandalism, he is never charged.
Frank continues to appear to Donnie and tells Donnie that they can do anything and won't get caught. Frank also tells Donnie about time travel, further confusing him. Soon, Donnie sees tubes of fluid light extending out of his family's chests, indicating where they will go. His own tube beckons him to follow as it enters his parents' room and reveals the gun his father keeps in a box in the closet. Donnie speaks about time travel with Mr. Monnitoff who gives him a book, The Philosophy of Time Travel written by Roberta Sparrow. She used to be a nun and a teacher at the high school. However, the climate at the school is becoming increasingly conservative as Kitty Farmer leads a protest against Ms. Pomeroy's choice of reading material; one of the stories she had assigned, Graham Greene's The Destructors features teenagers who destroy a man's house by flooding it. Ms. Pomeroy is fired and Mr. Monnittoff, who is also her boyfriend, refuses to discuss time travel with Donnie once his questions take a theological direction.
Gretchen and Donnie grow closer. She is one of the few people he opens up to about his time travel visions, and they discuss how they wish they could travel back in time and prevent the bad things in their lives from happening. Dr. Thurman increases Donnie's medication and begins hypnotherapy with him. But Frank continues to appear to Donnie. One night, Donnie and Gretchen go to see a horror movie. Gretchen falls asleep and Frank appears. When Donnie asks Frank to remove his bunny suit, Frank asks Donnie to remove his human suit, then acquiesces and takes the head off, revealing a young adult with a gruesome wound in his right eye. When Donnie asks about the cause of the eye wound, Frank whispers "I am so sorry" and then directs Donnie's attention to the movie screen. A portal opens, revealing Jim Cunningham's house. Frank tells Donnie to burn it to the ground. Donnie leaves the sleeping Gretchen in the theatre and does as Frank tells him to. He is not caught, and firefighters discover a kiddie porn dungeon in a hidden room in the mansion. Cunningham is arrested the next morning. Kitty Farmer, a friend and devoted follower of Cunningham's, decides she must lead his public defense and asks Rose to accompany the school's dance team, Sparkle Motion, to Los Angeles to appear on Star Search. Samantha is Sparkle Motion's lead dancer and, against her better judgment, Rose agrees. Because Eddie is away on business, this means Elizabeth and Donnie are on their own.
Elizabeth is accepted into Harvard, and she and Donnie decide to throw a Halloween party to celebrate. The night of the party (October 30), Gretchen comes to Donnie's house for safety because her mother has suddenly disappeared. Donnie comforts her and they make love, ignoring phone calls from Donnie's desperate therapist (who knows that Donnie is responsible for the vandalism to the high school and Jim Cunningham's house) and Rose, who calls to announce that Sparkle Motion won their initial Star Search competition and that they will return on a red eye flight that night.
At midnight, Donnie has another hallucination about the fluid light tunnels. He realizes that the 28 days have passed, and that only 6 hours remain until the end of the world. Convinced that Grandma Death is in some way connected to Frank, Donnie persuades Gretchen and two other friends to go with him to her house. When they get there, they are assaulted by the high school's resident bullies (Alex Greenwald and Seth Rogen). Gretchen is thrown dazed into the road, where she is struck and killed by a car driven by Frank (James Duval), Elizabeth's boyfriend who is on his way to their Halloween party. Frank is wearing the creepy bunny costume that Donnie's hallucination wears. Donnie uses his father's gun to shoot Frank in the right eye, killing him, then carries Gretchen's body to his home. He steals the car keys from a sleeping Elizabeth and, taking Gretchen with him, drives into the hills above town.
From that vantage point, Donnie can see a time tunnel forming over the town. The red eye flight carrying Rose and Sparkle Motion enters the turbulence created by the time tunnel, and one of the engines on the jet breaks free and falls into the tunnel. Donnie looks at Gretchen with love and then drives into the time tunnel.
It is October 2. Donnie lies in bed, laughing, happy. Shortly after he goes to sleep, the jet engine from the red eye flight on October 30 crashes through the roof, killing him. Throughout town, Dr. Thurman, Mr. Monnitoff, Kitty Farmer, Jim Cunningham and Frank all are suddenly troubled and sad. The next morning, Gretchen rides her bike to the Darkos' house. Elizabeth, Eddie and Samantha stand sobbing as Donnie's corpse is taken away, while Rose smokes a cigarette a few feet away, doing her best to deal with the fact that her last encounter with her troubled son was the unpleasant confrontation in his bedroom. Gretchen finds out from a young boy what had happened and who the family is, as she had never met Donnie. Touched by the tragedy, she shyly waves to Rose. Touched by a stranger's act of kindness, Rose waves back.