In order to make himself appear superior, a miller lies to the king, telling him that his daughter can spin straw into gold. (Some versions make the miller's daughter blonde and describe the "straw-into-gold" claim as a careless boast the miller makes about the way his daughter's straw-like blonde hair takes on a gold-like lustre when sunshine strikes it.) The king calls for the girl, shuts her in a tower room filled with straw and a spinning wheel, and demands she spin the straw into gold by morning or he will cut off her head (other versions have the king threatening to lock her up in a dungeon forever). When she has given up all hope, an imp-like creature appears in the room and spins the straw into gold in return for her necklace (since he only comes to people seeking a deal/trade). When next morning the king takes the girl to a larger room filled with straw to repeat the feat, the imp spins in return for the girl's ring. On the third day, when the girl has been taken to an even larger room filled with straw and told by the king that he will marry her if she can fill this room with gold or execute her if she cannot, the girl has nothing left with which to pay the strange creature. He extracts from her a promise that she will give him her firstborn child and so he spins the straw into gold a final time.
The king keeps his promise to marry the miller's daughter. But when their first child is born, the imp returns to claim his payment: "Now give me what you promised." She offers him all the wealth she has to keep the child but the imp has no interest in her riches. He finally consents to give up his claim to the child if she can guess his name within three days. Her many guesses fail, but before the final night, she wanders into the woods searching for him and comes across his remote mountain cottage and watches, unseen, as he hops about his fire and sings. In his song's lyrics, "tomorrow, tomorrow, tomorrow, I'll go to the king's house, nobody knows my name, I'm called 'Rumpelstiltskin'", he reveals his name. Some versions have the imp limiting the number of daily guesses to three and hence the total number of guesses allowed to a maximum of nine.
When the imp comes to the queen on the third day, after first feigning ignorance, she reveals his name, Rumpelstiltskin, and he loses his temper and their bargain. (Versions vary about whether he accuses the devil or witches of having revealed his name to the queen.) In the 1812 edition of the Brothers Grimm tales, Rumpelstiltskin then "ran away angrily, and never came back". The ending was revised in a 1857 edition to a more gruesome ending wherein Rumpelstiltskin "in his rage drove his right foot so far into the ground that it sank in up to his waist; then in a passion he seized the left foot with both hands and tore himself in two". Other versions have Rumpelstiltskin driving his right foot so far into the ground that he creates a chasm and falls into it, never to be seen again. In the oral version originally collected by the Brothers Grimm, Rumpelstiltskin flies out of the window on a cooking ladle.
The same story pattern appears in numerous other cultures: Tom Tit Tot in England (from English Tales by Joseph Jacobs), Whuppity Stoorie in Scotland (from Robert Chambers's Popular Rhymes of Scotland), Gilitrutt in Iceland, Joaidane جعيدان in Arabic (he who talks too much), Khlamushka Хламушка (junker) in Russia, Rumplcimprcampr, Rampelník or Martin Zvonek in the Czech Republic, Martinko Klingáč in Slovakia, Ruidoquedito (meaning "little noise") in South America, Pancimanci in Hungary (from A Csodafurulya by Kolozsvari Grandpierre Emil), Cvilidreta (whine-screamer) in Serbia and Croatia, Tremotino in Italy, Ootz-li Gootz-li עוּץ-לי גוּץ-לי in Israel (a compact and rhymy touch to the original sentence and meaning of the story, "My adviser my midget"), Daiku to Oniroku (daiku means "a carpenter", to means "and", and Oniroku is an ogre's name), "大工と鬼六" in Japan and Myrmidon in France.
These tales are Aarne-Thompson type 500, The Name of the Helper.
Another of the Grimm's tales revolves about a girl trapped by false claims about her spinning abilities, The Three Spinners. However, the three women who assist that girl do not demand her firstborn, but instead ask that she invite them to her wedding and say that they are relatives of hers. She complies, and when the three appear at the wedding, amazing the king with their ugliness, they tell the king that their various deformities (an overgrown thumb in one, a pendulous lip in the second, an enormous foot in the third) are the result of their years of spinning. The horrified king decrees that the bride will spin no more. In contrast to Rumpelstiltskin's self-seeking, therefore, these helpers ask only the "payment" of extending their benevolence to the heroine, and ensure that she will not need their help again. In one Italian variant, the girl must discover their names, as with Rumpelstiltskin, but not for the same reason: she must use their names to invite them, and she has forgotten them.
The name Rumpelstilzchen in German means literally "little rattle stilt". (A stilt is a post or pole which provides support for a structure.) A rumpelstilt or rumpelstilz was the name of a type of goblin, also called a pophart or poppart that makes noises by rattling posts and rapping on planks. The meaning is similar to rumpelgeist ("rattle ghost") or poltergeist, a mischievous spirit that clatters and moves household objects. (Other related concepts are mummarts or boggarts and hobs that are mischievous household spirits that disguise themselves.) The ending -chen is a German diminutive cognate to English -kin.
The earliest known mention of Rumpelstiltskin occurs in Johann Fischart's Geschichtklitterung, or Gargantua of 1577 (a loose adaptation of Rabelais' Gargantua and Pantagruel) which refers to an "amusement" for children named "Rumpele stilt or the Poppart".