The story begins with a curious mystery in a royal household: a king discovers that his twelve daughters, who sleep in a locked room, wake up every morning with their shoes mysteriously damaged. The "heels were worn and the toes were scuffed," leading the king to deduce that "these girls have been dancing." Determined to uncover the secret, the king issues a challenge to his kingdom: anyone who can solve the mystery within three nights will be allowed to marry one of his daughters and eventually inherit the throne. Failure, however, carries a heavy price—the suitor must leave the kingdom forever. Many princes attempt the task, but they all fail, consistently falling asleep after dinner, unable to witness the nightly activities of the princesses.
A lone soldier, wandering through the city, learns of this challenge from an old woman. Unlike the wealthy princes before him, the soldier is guided by the woman’s wisdom. She advises him not to eat the food provided by the king, as it is likely drugged to induce sleep. Furthermore, she gifts him a "magic cloak" that allows him to "become invisible." Armed with this supernatural advantage, the soldier approaches the king and accepts the challenge.
Upon arriving at the castle, the soldier plays the part of a weary traveler. When the princess brings his dinner, he avoids eating it and instead "threw it all out the window." He then lies on his bed and pretends to "snore loudly." This performance successfully deceives the princesses, who believe he is fast asleep. Confident in their secrecy, the sisters prepare for their nightly excursion, adorning themselves in "shimmering dresses" and ribbons, eager for the "music" and their "dashing dancing partners."
As the princesses prepare to leave, the oldest sister taps on her bed, revealing a "large trap door" and a "long staircase" spiraling into the depths. The soldier, now wearing his invisible cloak, follows them. As they descend, he accidentally steps on the youngest sister’s dress, causing her to cry out, though her sisters dismiss it as the dress catching on a "nail."
The group enters a magical realm where the path is lined with trees featuring leaves of "silver," "gold," and "diamonds." To provide concrete evidence for the king, the soldier breaks off a branch from each type of tree, creating a "large cracking sound" that briefly alarms the youngest princess. Eventually, they reach a lake where twelve princes wait in boats to ferry them to a distant "magical palace." There, the princesses dance through the night, their "beautiful dresses spinning and sparkling in the moonlight."
The soldier observes the entire event, confirming exactly how the shoes became "worn through." He returns to the castle ahead of the princesses each night, maintaining his facade of snoring. After three nights, he presents his findings to the king, detailing the "avenues of trees" and the "magical palace" where the ball took place. He produces the broken branches and a golden cup as proof. Faced with this irrefutable evidence, the princesses confess the truth.
The king is satisfied with the revelation and honors his promise. The soldier, opting for a modest choice, asks to marry the eldest daughter. The story concludes with a grand wedding celebration, where music and laughter fill the air, and the princesses dance one last time, finally ending the mystery of their worn-out shoes.