When the king becomes unhappy, he addresses one of his subjects for support. The subject in question is the miller, who brags that his beautiful daughter is capable of spinning straw into gold. Overjoyed by the news, the king summons her to his court at once. He is pleased with her physique, but locks her in a room full of straw, insisting she spin it to gold by morning. Of course, the girl admits that she cannot do such a thing, but the king tells her that unless she does so, she will die.
A funny, little man visits the forlorn girl and asks her to give something valuable to him in exchange for him spinning the straw into gold. She does, and he saves her! Unfortunately, the king then takes her to a larger room and demands that she spin that straw into gold as well. Luckily, the little man returns, but the girl is running out of valuables. She gives him her last valuable thing and he saves her skin once more.
Finally, the king takes the girl to an even larger room, and now the girl has no idea what she will do! The king promises to marry her if she succeeds, but she has nothing to give the little man. He asks that the girl promise him her first-born child, and desperate, she agrees.
The next day, the miller's daughter marries the king, and sometime later, she gives birth to her first child. When the little man comes to claim his prize, she begs with him to reconsider, so he makes her a wager: If she can guess what his name is, she will be allowed to keep her child. She will have three chances.
Quickly, the queen summons her servants to scout the little man, but after two attempts at name-guessing, she finds that her servants do not follow the little man after dark. The queen visits the woods late at night on her own, and overhears a drunken houseguest call the little man Rumpelstiltskin. On her third attempt, the queen guesses his name - and the little man throws a violent fit.
When the king returns, he has no idea of the chaos that has befallen his wife and child, and the three of them live happily ever after.