The story begins on Christmas Eve, at the Stahlbaum house. Marie, seven, and her brother, Fritz, eight, sit outside the parlor speculating about what kind of present their godfather, Drosselmeier, who is a clockmaker and inventor, has made for them. They are at last allowed in, where they receive many splendid gifts, including Drosselmeier's, which turns out to be a clockwork castle with mechanical people moving about inside it. However, as they can only do the same thing over and over without variation, the children quickly tire of it. At this point, Marie notices a nutcracker, and asks to whom he belongs. Her father tells her that he belongs to all of them, but that since she is so fond of him she will be his special caretaker. She, Fritz, and their sister, Louise, pass him among them, cracking nuts, until Fritz tries to crack one that is too big and hard, and the nutcracker's jaw breaks. Marie, upset, takes him away and bandages him with a ribbon from her dress.
When it is time for bed, the children put their Christmas gifts away in the special cabinet where they keep their toys. Fritz and Louise go up to bed, but Marie begs to be allowed to stay with the nutcracker a while longer, and she is allowed to do so. She puts him to bed and tells him that Drosselmeier will fix his jaw as good as new. At this, his face seems momentarily to come alive, and Marie is frightened, but she then decides it was only her imagination.
The grandfather clock begins to chime, and Marie believes she sees Drosselmeier sitting on top of it, preventing it from striking. Mice begin to come out from beneath the floor boards, including the seven-headed Mouse King. The dolls in the toy cabinet come alive and begin to move, the nutcracker taking command and leading them into battle after putting Marie's ribbon on as a token. The battle goes to the dolls at first, but they are eventually overwhelmed by the mice. Marie, seeing the nutcracker about to be taken prisoner, takes off her slipper and throws it at the Mouse King. She then faints into the toy cabinet's glass door, cutting her arm badly.
Marie wakes up in her bed the next morning with her arm bandaged and tries to tell her parents about the battle between the mice and the dolls, but they do not believe her, thinking that she has had a fever dream caused by the wound she sustained from the broken glass. Several days later, Drosselmeier arrives with the nutcracker, whose jaw has been fixed, and tells Marie the story of Princess Pirlipat and Madam Mouserinks, who is also known as the Queen of the Mice, which explains how nutcrackers came to be and why they look the way they do.
The Mouse Queen tricked Pirlipat's mother into allowing her and her children to gobble up the lard that was supposed to go into the sausage that the King was to eat at dinner that evening. The King, enraged at the Mouse Queen for spoiling his supper and upsetting his wife, had his court inventor, whose name happens to be Drosselmeier, create traps for the Mouse Queen and her children.