British animal liberation activists break into a laboratory in Cambridge and are caught by a scientist while trying to free some chimpanzees being used for medical research. Despite the warnings of the chief scientist that the chimps are infected with a virus dubbed "Rage," which he claims is highly contagious and only takes one bite to spread, the activists open the cages anyway and release the chimpanzees. A chimp attacks a female activist and immediately infects her, and she in turn infects the other members of the group, including the chief scientist when he attempts to kill her.
Twenty-eight days later, a bicycle courier named Jim (Cillian Murphy) awakens from a coma in the deserted St Thomas' Hospital. As he leaves, he discovers London deserted with signs of catastrophe everywhere. Jim is soon discovered and chased through the streets by psychotic people before being rescued by two survivors, Selena (Naomie Harris) and Mark (Noah Huntley), who kill Jim's pursuers with Molotov cocktails and a petrol station explosion. After, they rush him to their hideout in the London Underground. There they reveal that while Jim was comatose from his accident, a virus spread uncontrollably among the populace, turning most people into rabid, psychotic "infected," resulting in societal collapse. They also explain that infection has been reported in Paris and New York. Selena and Mark accompany Jim to his parents' house the next morning, where he discovers that they committed suicide, leaving a note for him. That night, two of the infected see a candle Jim lights in the kitchen and attack. Mark is badly cut and covered in infected blood; Selena quickly kills him, later explaining to Jim that the Rage virus overwhelms its victims in no more than twenty seconds. This necessitates the immediate killing of people who may have been infected. She also assures him that, should he get infected, she would kill him "in a heartbeat." After leaving, they discover two more survivors, Frank (Brendan Gleeson) and his teenage daughter, Hannah (Megan Burns), holed up in a block of flats, and are invited to spend the rest of the night.
Frank informs them the next day that supplies, particularly water, are dwindling, and plays them a pre-recorded radio broadcast apparently transmitted by an Army blockade near Manchester, who claim to have "the answer to infection" and invites any survivor to try to reach their safe haven. The survivors board Frank's cab in search of the signal source and during the trip bond with one another in various situations. When the four reach the deserted blockade, Frank is infected when a drop of blood from a dead body falls into his eye. As he succumbs, he is killed by the arriving soldiers, who then take the remaining group to a fortified mansion under the command of Major Henry West (Christopher Eccleston). After settling in the mansion, West promises the three protection from the infected. However, Jim quickly discovers that West's "answer to infection" involves waiting for the infected to starve to death, and his broadcast of the radio message was launched to attract female survivors into sexual slavery to rebuild the population with his platoon's members. Jim attempts to escape with Selena and Hannah, but is captured by the soldiers, along with a Sergeant Farrell (Stuart McQuarrie), who disagrees with the major's plan and tried to stop the other soldiers from imprisoning the group. During their imprisonment, Farrell theorises that there is no worldwide pandemic, but rather that Great Britain has been quarantined.
The next day, Selena and Hannah are made to dress in evening wear and prepared for rape, as two soldiers lead Jim and Farrell to be executed. After his escorts quarrel after killing Farrell, Jim manages to escape and notices the contrail of a jet aircraft flying high overhead, which largely confirms Farrell's theory. After luring West and one of his men to the blockade and ambushing them, Jim runs back to the soldiers' headquarters where he unleashes Mailer, an infected soldier that West kept chained outside for observation. Mailer attacks the soldiers in the mansion, while Jim sets out to rescue the girls, who had been split up in the chaos. Selena, held hostage by a surviving soldier, is then rescued by Jim, who arrives and savagely kills her captor with his bare hands. Selena mistakes Jim for an infected and raises her machete to kill him, but when she hesitates, Jim remarks "That was longer than a heartbeat." The two kiss, reunite with Hannah, and run to Frank's cab, only to encounter a vengeful West, who shoots Jim in the stomach. Hannah commandeers the cab and backs it up to the front door, where Mailer drags West out through the rear window and kills him. She then drives away with Jim and Selena.
Selena and Hannah rush Jim into a deserted hospital, where Selena performs life-saving emergency procedures. Twenty-eight days later, Jim is shown waking up in recovery again, this time at a remote cottage. Downstairs, he finds Selena sewing large swaths of fabric when Hannah appears. The three rush outside and unfurl a huge cloth banner, adding the final letter to the word "HELLO" laid out on the meadow. As a Finnish fighter jet flies over the landscape, infected people are shown lying by the side of a road, dying of starvation. The jet flies past the three waving survivors and their distress sign, and as it flies away Selena says with a smile: "Do you think he saw us this time?"
The DVD extras include three alternative endings, all of which conclude with Jim dying. Two were filmed, while the third, a more radical departure, was presented only in storyboards. On 25 July 2003, cinemas started showing the alternative ending after the film's credits.
In this ending, after Jim is shot, Selena and Hannah still rush him to the deserted hospital, but the scene is extended. Selena, with Hannah's assistance, attempts to perform life-saving procedures but cannot revive Jim. Selena is heartbroken, and Hannah, distraught, looks to her for guidance. Selena tells Hannah that they will go on; they pick up their guns and walk away from Jim's lifeless body. Selena and Hannah, still dressed in ballgowns and fully armed, walk through the operating room doors, which gradually stop swinging.
On the DVD commentary, Boyle and Garland explain that this was the original ending of the film's first cut, which was tested with preview audiences. It was rejected for seeming too bleak; the final exit from the hospital was intended to imply Selena and Hannah's survival, whereas test audiences felt that the women were marching off to certain death. Boyle and Garland express a preference for this alternative ending, calling it the "true ending." They comment that this ending brought Jim full circle, as he starts and finishes the story in bed in a deserted hospital.
This ending was added in the theatrical release of the film beginning on 25 July 2003, placed after the credits and prefaced with the words "what if..."
This ending, for which only a rough edit was completed, is an alternative version of the potential rescue sequence shown at the very end of the released film. Here, the scenes are identical, except that this ending was intended to be placed after the first alternative ending where Jim dies, so he is absent. When Selena is sewing one of the banner letters in the cottage, she is seen facetiously talking to a chicken instead of Jim. Only Selena and Hannah are seen waving to the jet flying overhead in the final shots.
The "Radical Alternative Ending", rather than a bare ending, is a radically different development of the movie from the midpoint onwards; it was not filmed and is presented on the DVD as a series of illustrated storyboards with voiceovers by Boyle and Garland. When Frank is infected at the military blockade near Manchester, the soldiers do not enter the story. Instead, Jim, Selena and Hannah are somehow able to restrain the infected Frank, hoping they will find a cure for the virus nearby as suggested in the radio broadcast. They soon discover that the blockade had protected a large medical research complex, the same one featured in the first scene of the film where the virus was developed. Inside, the party is relieved to find a scientist self-barricaded inside a room with food and water. He will not open the door because he fears they will take his food, although he does admit that the "answer to infection is here". Unfortunately, he refuses to talk further because he does not want to make an emotional attachment to people who will soon be dead. After hours of failed attempts to break through the door or coax the man out, Jim eventually brings Hannah to the door and explains Frank's situation. The scientist reluctantly tells them that Frank can only be cured with a complete blood transfusion, and supplies them with the necessary equipment. After learning that he is the only match with Frank's blood type, Jim sacrifices himself so that Frank can survive with his daughter. Just as his journey began, Jim is left alone in the abandoned medical facility, and Selena, Hannah and Frank move into the room with the scientist as a horde of the infected breach the complex. The computer monitors show death and destruction come to life around a thrashing, infected Jim, who is strapped to the same table as the chimp had been in the opening scene.
Garland and Boyle explain that they conceived this ending to see what the film would be like if they did not expand the focus beyond the four core survivors. They decided against it because the idea of a total blood replacement as a cure was not credible. As Boyle said in the DVD commentary, it "didn't make much sense" since the film had already established that one drop of blood can infect a person. "What would we do? Drain him of blood and scrub his veins with bleach?"
The "Hospital Dream" ending is an extended version of the theatrical alternative ending where Jim dies at the hospital. It is revealed by the director during the optional commentary that this was the full version of the original ending. Jim dreams while unconscious and remembers the final moments on his bicycle before the crash. The footage cuts back and forth between the scene with Selena and Hannah trying to save his life and the dream sequence. As he gets hit by a car in his flashback, he simultaneously dies on the operating table.