During an argument over the length of her skirt, Wendla Bergmann confides to her mother that she sometimes thinks about death. When she asks her mother if that is sinful, her mother avoids the question. Wendla jokes that she may one day wear nothing underneath the long dress.
After school Melchior Gabor and Moritz Stiefel engage in small talk, before both confiding that they have recently been tormented by sexual dreams and thoughts. Melchior knows about the mechanics of sexual reproduction, but Moritz is woefully ignorant and proposes several hypothetical techniques (such as having brothers and sisters share beds, or sleeping on a firm bed) that might prevent his future children from being as tense and frightened as he is. As an atheist, Melchior blames religion for Moritz's fears. Before departing, Melchior insists Moritz come over to his house for tea, where Melchior will show him diagrams and journals with which he will teach Moritz about life. Moritz leaves hastily, embarrassed.
Martha, Thea, and Wendla, cold and wet from a recent storm, walk down the street and talk about how Melchior and the other boys are playing in the raging river. Melchior can swim, and the girls find his athletic prowess attractive. After Wendla offers to cut Martha's hair after noticing her braid has come undone, Martha confesses that her father savagely beats her for trivial things (e.g., wearing ribbons on her dress) and sometimes sexually abuses her. The three girls are united by the fact that they do not know why they seem to disappoint their parents so much these days. Melchior walks by; Wendla and Thea swoon. They remark on how beautiful he is and how pathetic his friend Moritz is, although Martha admits finding Moritz sensitive and attractive.
As the boys watch from the schoolyard, Moritz sneaks into the principal's office to look at his academic files. Because the next classroom only holds 60 pupils, Moritz must rank at least 60th in his class in order to remain at school (a requisite he is unsure he can manage). Fortunately, Moritz safely returns, euphoric: he and Ernst Robel are tied academically—the next quarter will determine who will be expelled. Melchior congratulates Moritz, who says that, were there no hope, he would have shot himself.
Wendla encounters Melchior in the forest. Melchior asks why she pays visits to the poor if they do not give her pleasure, to which Wendla answers that enjoyment is not the point, and after recounting a dream she had where she was an abused, destitute child, Wendla tells Melchior about Martha's family situation. Wendla, shameful that she has never been struck once in her life, asks Melchior to show her how it feels. He hits her with a switch, but not very hard, provoking Wendla to yell at him to hit her harder. Suddenly overcome, Melchior violently beats her with his fists and then runs off crying.
Days later, Moritz has grown weary from fear of flunking out. Seeking help, he goes to Melchior's house to study Faust. There, he is comforted by Melchior's kind mother, who disapproves of reading Faust before adulthood. After she leaves, Melchior complains about those who disapprove of discussing sexuality. While Moritz idolizes femininity, Melchior admits that he hates thinking about sex from the girl's viewpoint.
Wendla asks her mother to tell her about "the stork," causing her mother to become suddenly evasive. Anxious, she tells Wendla that women have children when they are married and in love.
One day, Wendla finds Melchior in a hayloft as a thunderstorm strikes. He kisses her, and insists that love is a "charade,". Melchior rapes Wendla as she pleads with him to stop, having no knowledge of sexual intercourse or what is happening. She later wanders her garden, distraught, begging God for someone who would explain everything to her. Despite great effort, Moritz's academics do not improve and he is expelled from school. Disgraced and hopeless, he appeals to Melchior's mother for money with which he can escape to America, but she refuses. Aware that Moritz is contemplating suicide, Mrs. Gabor writes Moritz a letter in which she asserts he is not a failure, in spite of whatever judgment society has passed upon him. Nonetheless, Moritz has been transformed into a physical and emotional wreck, blaming both himself and his parents for not better preparing him for the world. Alone, he meets Ilse, a former friend who ran away to the city to live a Bohemian life with several fiery, passionate lovers. She offers to take Moritz in, but he rejects her offer. After she leaves, Moritz shoots himself.
After an investigation, the professors at the school hold that the primary cause of Moritz's suicide was an essay on sexuality that Melchior wrote for him. Refusing to let Melchior defend himself, the authorities roundly expel him. At Moritz's funeral, the adults call Moritz's suicide selfish and blasphemous; Moritz's father disowns him. The children come by later and pay their own respects. As they all depart, Ilse divulges to Martha that she found Moritz's corpse and hid the pistol he used to kill himself.
Mrs. Gabor is the only adult who believes Melchior and Moritz committed no wrongdoing, and that Melchior was made into a scapegoat. Mr. Gabor, however, brands his son's actions as depraved. He shows her a letter that Melchior wrote to Wendla, confessing his remorse over "sinning against her." Upon recognizing Melchior's handwriting, she breaks down. They decide to put Melchior in a reformatory. There, several students intercept a letter from Wendla; aroused, they masturbate as Melchior leans against the window, haunted by Wendla and the memory of Moritz.
Wendla suddenly falls ill. A doctor prescribes pills, but after he leaves, Wendla's mother informs her of the true cause of her sickness: pregnancy. She condemns Wendla for her sins. Wendla is helpless and confused, since she never loved Melchior, and she yells at her mother for not teaching her properly. An abortionist arrives. Meanwhile, back at school, Hanschen Rilow and Ernst Robel share a kiss and confess their homosexuality to each other.
In November, an escaped Melchior hides in a cemetery where he discovers Wendla's tombstone, which attests that she died of anemia. There, he is visited by Moritz's ghost, who is missing part of his head. Moritz explains that, in death, he has learned more and lived more than in his tortured life on earth. Melchior is almost seduced into traveling with Moritz into death, but a mysterious figure called the Masked Man intervenes. Moritz confesses that death, in fact, is unbearable; he only wanted to have Melchior as a companion again. The Masked Man informs Melchior that Wendla died of an unnecessary abortion, and that he has appeared to teach him the truth about life in order to rescue him from death. Melchior and Moritz bid each other farewell as the cryptic figure guides Melchior away.