Part 1: Alex's world
Alex, a teenager living in near-future dystopian England, leads his gang on a night of opportunistic, random "ultra-violence". Alex's friends ("droogs" in the novel's Anglo-Russian slang, 'Nadsat') are: Dim, a slow-witted bruiser who is the gang's muscle; Georgie, an ambitious second-in-command; and Pete, who mostly plays along as the droogs indulge their taste for ultra-violence. Characterized as a sociopath and a hardened juvenile delinquent, Alex also displays intelligence, quick wit, and a predilection for classical music; he is particularly fond of Beethoven, referred to as "Lovely Ludwig Van".
The novella begins with the droogs sitting in their favorite hangout (the Korova Milk Bar), drinking "milk-plus", a drink consisting of milk, prodded with the customer's choice of certain drugs, including "vellocet", "synthemesc", or "drencrom" (which is what Alex and his droogs were drinking, according to Alex's own first-person narration). This drug, referred to as "knives", would "sharpen you up", as it did for Alex, in preparation of the night's mayhem. They assault a scholar walking home from the public library, rob a store, leaving the owner and his wife bloodied and unconscious, stomp a panhandling derelict, then scuffle with a rival gang. Joyriding through the countryside in a stolen car, they break into an isolated cottage and maul the young couple living there, beating the husband and raping his wife. In a metafictional touch, the husband is a writer working on a manuscript called "A Clockwork Orange," and Alex contemptuously reads out a paragraph that states the novel's main theme before shredding the manuscript. Back at the milk bar, Alex strikes Dim for his crude response to a woman's singing of an operatic passage, and strains within the gang become apparent. At home in his parents' dreary flat, Alex plays classical music at top volume while fantasizing about more orgiastic violence.
Alex skips school the next day. Following an unexpected visit from P. R. Deltoid, his "post-corrective advisor," Alex meets a pair of ten-year-old girls and takes them back to the flat, where he serves them scotch and soda, injects himself with hard drugs, and then rapes them. That evening, Alex finds his droogs in a mutinous mood. Georgie challenges Alex for leadership of the gang, demanding that they pull a "man-sized" job. Alex quells the rebellion by slashing Dim's hand and fighting with Georgie, then in a show of generosity takes them to a bar, where Alex insists on following through on Georgie's idea to burgle the home of a wealthy old woman. Alex breaks in and knocks the woman unconscious, but when he opens the door to let the others in, Dim strikes him in payback for the earlier fight. The gang abandons Alex on the front step to be arrested by the police; while in their custody, he learns that the woman has died from her injuries.
Part 2: The Ludovico Technique
Alex is convicted of murder and sentenced to 14 years in prison. Two years into his sentence, he has obtained a job in one of the prison chapels playing religious music on the stereo to accompany the Sunday religious services. The chaplain mistakes Alex's Bible studies for stirrings of faith (Alex is actually reading Scripture for the violent passages). After Alex's fellow cellmates blame him for beating a troublesome cellmate to death, he is chosen to undergo an experimental behaviour-modification treatment called the Ludovico Technique in exchange for having the remainder of his sentence commuted. The technique is a form of aversion therapy in which Alex receives an injection that makes him feel sick while watching graphically violent films, eventually conditioning him to suffer crippling bouts of nausea at the mere thought of violence. As an unintended consequence, the soundtrack to one of the films, the final movement of Beethoven's Ninth Symphony, renders Alex unable to enjoy his beloved classical music as before.
The effectiveness of the technique is demonstrated to a group of VIPs, who watch as Alex collapses before a walloping bully, and abases himself before a scantily-clad young woman whose presence has aroused his predatory sexual inclinations. Although the prison chaplain accuses the state of stripping Alex of free will, the government officials on the scene are pleased with the results and Alex is released from prison.
Part 3: After prison
Since his parents are now renting his room to a lodger, Alex wanders the streets homeless. He enters a public library where he hopes to learn a painless way to commit suicide. There, he accidentally encounters the old scholar he assaulted earlier in the book, who, keen on revenge, beats Alex with the help of his friends. The policemen who come to Alex's rescue turn out to be none other than Dim and former gang rival Billyboy. The two policemen take Alex outside of town and beat him up. Dazed and bloodied, Alex collapses at the door of an isolated cottage, realizing too late that it is the house he and his droogs invaded in the first part of the story. Because the gang wore masks during the assault, the writer does not recognize Alex. The writer, whose name is revealed as F. Alexander, shelters Alex and questions him about the conditioning. During this sequence, it is revealed that Mrs. Alexander died of injuries inflicted during the gang-rape, while her husband has decided to continue living "where her fragrant memory persists" despite the horrid memories. Alex reveals in his description that he has been conditioned to feel intolerable deathly nausea on hearing certain classical music. Alexander, a critic of the government, intends to use Alex's therapy as a symbol of state brutality and thereby prevent the incumbent government from being re-elected, but a careless Alex soon inadvertently reveals that he was the ringleader during the night two years ago. Frightened for his own safety, Alex blurts out a confession to the writer's radical associates after they remove him from F. Alexander's home. Instead of protecting him, however, they imprison Alex in a dreary flat not far from his parents' residence. They pretend to leave, and then while he is sleeping in a locked bedroom subject him to a relentless barrage of classical music, prompting him to attempt suicide by leaping from a high window.
Alex wakes up in a hospital, where he is courted by government officials anxious to counter the bad publicity created by his suicide attempt. With Alexander placed in a mental institution, Alex is offered a well-paying job if he agrees to side with the government. As photographers snap pictures, Alex daydreams of orgiastic violence and reflects upon the news that his Ludovico conditioning has been reversed (through an unexplained process involving hypnopædia) as part of his recovery: "I was cured, all right".
In the final chapter, Alex finds himself half-heartedly preparing for yet another night of crime with a new trio of droogs. After a chance encounter with Pete, who has reformed and married, Alex finds himself taking less and less pleasure in acts of senseless violence. He begins contemplating giving up crime himself to become a productive member of society and start a family of his own, while reflecting on the notion that his own children will be just as destructive—if not more so—than he himself.