A Clockwork Orange introduces teenage Alex, who lives in a world that fears him. Gangs run amok and violently beat, rape, and destroy for fun in this future dystopian Britain; however, this all changes for Alex when he is arrested and sentenced to endure the revolutionary rehabilitation technique of brainwashing. No longer able to commit violence without being physically sick, Alex is now defenseless in a world tailor-made for delinquency. His plight brings up questions of morality and ethics, exploring the grey areas of punishment as related to free will.
Alex is a 15-year-old living in near-future dystopian England who 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. Characterised 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, and drinking "milk-plus" - a beverage consisting of milk laced with the customer's drug of choice - to prepare for a night of mayhem. They assault a scholar walking home from the public library; rob a store, leaving the owner and his wife bloodied and unconscious; beat up a beggar; then scuffle with a rival gang. Joyriding through the countryside in a stolen car, they break into an isolated cottage and terrorise 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 Korova, 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' futuristic flat, Alex plays classical music at top volume, which he describes as giving him orgasmic bliss before falling asleep.
Alex coyly feigns illness to his parents to stay out of school the next day. Following an unexpected visit from P.R. Deltoid, his "post-corrective advisor", Alex visits a record store, where he meets two pre-teen girls. He invites them back to the flat, where he drugs and rapes them. The next morning, Alex finds his droogs in a mutinous mood, waiting downstairs in the torn-up and graffitied lobby. 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.
Alex is convicted of murder and sentenced to 14 years in prison. Two years into his term, 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; in reality, Alex is only reading Scripture for the violent passages. After his 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 is injected with nausea-inducing drugs while watching graphically violent films, eventually conditioning him to become severely ill at the mere thought of violence. As an unintended consequence, the soundtrack to one of the films, Beethoven's Fifth 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 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.
Alex returns to his parents' flat, only to find that they are renting his room to a lodger. Now homeless, he wanders the streets and enters a public library, hoping to learn of a painless method for committing suicide. The old scholar whom Alex had assaulted in Part 1 finds him and beats him, with the help of several friends. Two policemen come to Alex's rescue, but turn out to be Dim and Billyboy, a former rival gang leader. They take Alex outside of town, brutalize him, and abandon him there. Alex collapses at the door of an isolated cottage, realising too late that it is the one he and his droogs invaded in Part 1. The writer, F. Alexander, still lives here, but his wife has since died of injuries she sustained in the gang-rape. He does not recognise Alex, but gives him shelter and questions him about the conditioning he has undergone. Alexander and his colleagues, all highly critical of the government, plan to use Alex as a symbol of state brutality and thus prevent the incumbent government from being re-elected. Alex inadvertently reveals that he was the ringleader of the home invasion; he is removed from the cottage and place him in a flat, locked in an upper-storey bedroom as a relentless barrage of classical music plays over speakers. He attempts suicide by leaping from the 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. A round of tests reveals that his old violent impulses have returned, indicating that the hospital doctors have undone the effects of his conditioning. As photographers snap pictures, Alex daydreams of orgiastic violence and reflects, "I was cured all right."
In the final chapter, Alex finds himself half-heartedly preparing for yet another night of crime with a new gang. 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 as he has been, if not more so.