Years later, a little boy, Kai, and a little girl, Gerda, live next door to each other in the garrets of buildings with adjoining roofs in a large city. One could get from Kai's to Gerda's home just by stepping over the gutters of each building. The two families grow vegetables and roses in window boxes placed on the gutters. Kai and Gerda have a window-box garden to play in, and they become devoted to each other as playmates.
Kai's grandmother tells the children about the Snow Queen, who is ruler over the snowflakes, that look like bees — that is why they are called "snow bees". As bees have a queen, so do the snow bees, and she is seen where the snowflakes cluster the most. Looking out of his frosted window, Kai, one winter, sees the Snow Queen, who beckons him to come with her. Kai draws back in fear from the window.
By the following spring, Gerda has learned a song that she sings to Kai: Where the roses deck the flowery vale, there, infant Jesus thee we hail! Because roses adorn the window box garden, Gerda is always reminded of her love for Kai by the sight of roses.
It was on a pleasant summer's day that splinters of the troll-mirror get into Kai's heart and eyes while he and Gerda are looking at a picture book in their window-box garden. Kai's personality changes: he becomes cruel and aggressive. He destroys their window-box garden, he makes fun of his grandmother, and he no longer cares about Gerda, since all of them now appear bad and ugly to him. The only beautiful and perfect things to him now are the tiny snowflakes that he sees through a magnifying glass.
The following winter he goes out with his sled to the market square and hitches it—as was the custom of those playing in the snowy square—to a curious white sleigh carriage, driven by the Snow Queen, who appears as a woman in a white fur-coat. Outside the city she shows herself to Kai and takes him into her sleigh. She kisses him only twice: once to numb him from the cold, and the second time to cause him to forget about Gerda and his family. She does not kiss him a third time as that would kill him. Kai is then taken to the Snow Queen's palace on Spitsbergen, near the North Pole where he is contented to live due to the splinters of the troll-mirror in his heart and eyes.
The people of the city, once they realize Kai is nowhere to be seen or found, get the idea that Kai drowned in the river nearby, but Gerda, who is heartbroken at Kai's disappearance, goes out to look for him. She questions everyone and everything about Kai's whereabouts. Gerda offers her new red shoes to the river in exchange for Kai; by not taking the gift at first, the river seems to let her know that Kai did not actually drown after all. Gerda next visits an old sorceress, who wants Gerda to stay with her forever. She causes Gerda to forget all about her friend and, knowing that the sight of roses will remind Gerda of Kai, the sorceress causes all the roses in her garden to sink beneath the earth. At the home of the old sorceress, a rosebush raised from below the ground by Gerda's warm tears tells her that Kai is not among the dead, all of whom it could see while it was under the earth. Gerda flees from the old woman's beautiful garden of eternal summer and meets a crow, who tells her that Kai was in the princess's palace. She subsequently goes to the palace and meets the princess and her prince, who appears very similar to Kai. Gerda tells them her story and they help by providing warm clothes and a beautiful coach. While traveling in the coach Gerda is captured by robbers and brought to their castle, where she is befriended by a little robber girl, whose pet doves tell her that they had seen Kai when he was carried away by the Snow Queen in the direction of Lapland. The captive reindeer Bae tells her that he knows how to get to Lapland since it is his home.
The robber girl, then, frees Gerda and the reindeer to travel north to the Snow Queen's palace. They make two stops: first at the Lapp woman's home and then at the Finn woman's home. The Finn woman tells the reindeer that the secret of Gerda's unique power to save Kai is in her sweet and innocent child's heart:
"I can give her no greater power than she has already," said the woman; "don't you see how strong that is? How men and animals are obliged to serve her, and how well she has got through the world, barefooted as she is. She cannot receive any power from me greater than she now has, which consists in her own purity and innocence of heart. If she cannot herself obtain access to the Snow Queen, and remove the glass fragments from little Kai, we can do nothing to help her.."
When Gerda gets to the Snow Queen's palace, she is first halted by the snowflakes which guard it. The only thing that overcomes them is Gerda's praying the Lord's Prayer, which causes her breath to take the shape of angels, who resist the snowflakes and allow Gerda to enter the palace. Gerda finds Kai alone and almost immobile on the frozen lake, which the Snow Queen calls the "Mirror of Reason" on which her throne sits. Gerda finds Kai engaged in the task that the Snow Queen gave him: he must use pieces of ice as components of a Chinese puzzle to form characters and words. If he is able to form the word "eternity" (Danish: Evigheden) the Snow Queen will release him from her power and give him a pair of skates. Gerda finds him, runs up to him, and weeps warm tears on him, which melt his heart, burning away the troll-mirror splinter in it. Kai bursts into tears, dislodging the splinter from his eye. Gerda kisses Kai a few times, and he becomes cheerful and healthy again, with sparkling eyes and rosy cheeks: he is saved by the power of Gerda's love. He and Gerda dance around on the lake of ice so joyously that the splinters of ice Kai has been playing with are caught up into the dance. When the splinters tire of dancing they fall down to spell the very word Kai was trying to spell, "eternity." Even if the Snow Queen were to return, she would be obliged to free Kai. Kai and Gerda then leave the Snow Queen's domain with the help of the reindeer, the Finn woman, and the Lapp woman. They meet the robber girl after they have crossed the line of vegetation, and from there they walk back to their home, "the big city." They find that all is the same at home, but they have changed! They are now grown up, and they are delighted to see that it is summertime. At the end, the grandmother reads a passage from the Bible:
"Assuredly, I say to you, unless you are converted and become as little children, you will by no means enter the kingdom of heaven" (Matthew 18:3).