The story begins on Christmas Eve at the Stahlbaum house. Marie, twelve years old, and her brother Fritz, eight, sit outside the parlor speculating about what kind of present their godfather Drosselmeyer, who is a clockmaker and inventor, has made for them. They are at last allowed into the parlor, where they receive many splendid gifts, including Drosselmeyer's, which turns out to be a clockwork castle with mechanical people moving about inside it. However, as the mechanical people can only do the same thing over and over without variation, the children quickly tire of it. At this point, Marie notices a Nutcracker doll, and asks whom he belongs to. 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. Marie, her sister Louise, and her brother Fritz pass the Nutcracker among them, cracking nuts, until Fritz tries to crack a nut that is too big and hard, and the Nutcracker's jaw breaks. Marie, upset, takes the Nutcracker 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 cupboard where they keep their toys. Fritz and Louise go up to bed, but Marie begs to be allowed to stay with Nutcracker a while longer, and she is allowed to do so. She puts Nutcracker to bed and tells him that Drosselmeyer will fix his jaw as good as new. At this, the Nutcracker's 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 Drosselmeyer 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. Marie, startled, slips and puts her elbow through the glass door of the toy cupboard. The dolls in the cupboard come alive and begin to move, Nutcracker taking command and leading them into battle after putting Marie's ribbon on as a token. The battle at first goes to the dolls, but they are eventually overwhelmed by the mice. Marie, seeing Nutcracker about to be taken prisoner, takes off her shoe and throws it at the Mouse King, then faints.
Marie wakes 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. Drosselmeyer soon arrives with the Nutcracker, whose jaw has been fixed, and tells Marie the story of Princess Pirlipat and the Queen of the Mice, which explains how Nutcrackers came to be and why they look the way they do.
The Queen of the Mice 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 Drosselmeyer, create traps for the Mouse Queen and her children.
The Mouse Queen, angered at the death of her children, swore that she would take revenge on the King's daughter, Pirlipat. Pirlipat's mother surrounded her with cats which were supposed to be kept awake by being constantly stroked, however inevitably the nurses who stroked the cats fell asleep and the Mouse Queen magically turned the infant Pirlipat ugly, giving her a huge head, a wide grinning mouth and a cottony beard, like a nutcracker. The King blamed Drosselmeyer and gave him four weeks to find a cure. At the end of four weeks, Drosselmeyer had no cure but went to his friend, the court astrologer.
They read Pirlipat's horoscope and told the King that the only way to cure her was to have her eat the nut Crackatook, which must be cracked and handed to her by a man who had never been shaved nor worn boots since birth, and who must, without opening his eyes hand her the kernel and take seven steps backwards without stumbling. The King sent Drosselmeyer and the astrologer out to look for the nut and the young man, charging them on pain of death not to return until they had found them.
The two men journeyed for many years without finding either the nut or the man, until finally they returned home and found the nut in a small shop. The man who had never been shaved and never worn boots turned out to be Drosselmeyer's own nephew. The King, once the nut had been found, promised his daughter's hand to whoever could crack the nut. Many men broke their teeth on the nut before Drosselmeyer's nephew finally appeared. He cracked the nut easily and handed it to the princess, who swallowed it and immediately became beautiful again, but Drosselmeyer's nephew, on his seventh backward step, trod on the Queen of the Mice and stumbled, and the curse fell on him, giving him a large head, wide grinning mouth and cottony beard; in short, making him a Nutcracker. The ungrateful Princess, seeing how ugly Drosselmeyer's nephew had become, refused to marry him and banished him from the castle.
Marie, while she recuperates from her wound, hears the King of the Mice whispering to her in the middle of the night, threatening to bite Nutcracker to pieces unless she gives him her sweets and her dolls. For Nutcracker's sake, Marie sacrifices her things, but the Mouse king wants more and more and finally Nutcracker tells Marie that if she will just get him a sword, he will finish the Mouse King. Marie asks Fritz for a sword for Nutcracker, and he gives her the sword of one of his toy hussars. The next night, Nutcracker comes into Marie's room bearing the Mouse King's seven crowns, and takes her away with him to the doll kingdom, where Marie sees many wonderful things. She eventually falls asleep in the Nutcracker's palace and is brought back home. She tries to tell her mother what happened, but again she is not believed, even when she shows her parents the seven crowns, and she is forbidden to speak of her "dreams" anymore.
As Marie sits in front of the toy cabinet one day, looking at Nutcracker and thinking about all the wondrous things that happened, she can't keep silent anymore and swears to the Nutcracker that if he were ever really real she would never behave as Princess Pirlipat behaved, and she would love him whatever he looked like. At this, there is a bang and she falls off the chair. Her mother comes in to tell her that godfather Drosselmeyer has arrived with his young nephew. Drosselmeyer's nephew takes Marie aside and tells her that by swearing that she would love him in spite of his looks, she broke the curse on him and made him handsome again. He asks her to marry him. She accepts, and in a year and a day he comes for her and takes her away to the Doll Kingdom, where she is crowned queen.