A completely fabricated film biography of the great Danish storyteller (the Danes were gratified that this movie paid tribute to their national hero, but were very annoyed that the scholarly poet was depicted as a vagabond shoemaker), which serves as a vehicle for Frank Loesser songs that recount the famous tales of Thumbelina, the Ugly Duckling, the King's New Clothes, and the Little Mermaid.
In the story, Hans Christian Andersen, a shoemaker, is booted out of his own village by the Town Council at the request of the local schoolmaster, who would rather the children of the village attend school than listen to Hans's fairy tales. Not wishing Hans to undergo any humiliation, his apprentice Peter convinces him to go to Copenhagen, before Hans can find out what the Town Council has decided. Peter goes with him.
Once there, Hans is promptly arrested for advertising his profession in front of the King's statue. He is released through the efforts of Peter and immediately hired by a ballet company, where the prima ballerina, Doro, insists that she needs new dancing slippers in order to be able to dance properly. Hans immediately falls head over heels for Doro, not knowing she is already married to Nils, the demanding and unpleasant ballet director. When he finishes the shoes and goes to deliver them, he accidentally witnesses a quarrel between Nils and Doro, which culminates in the two of them slapping each other.
Hans immediately decides to himself that Doro is miserable and unhappy (she is not), and writes the story "The Little Mermaid" for her. As Peter reads it for the first time, the sheets of paper are blown by the wind and end up at the ballet studio, where Doro reads it and immediately concludes that Hans has written the story so that she and Nils can turn it into a ballet. Hans is delighted when he hears the news.
One day, while Hans is telling stories to the children, he notices a completely bald boy, Lars, being teased. Lars has lost his hair because of a fever. Hans tells the boy the story of "The Ugly Duckling", which gives Lars new confidence. In gratitude, Lars's father, a newspaper publisher, prints the story in the local paper and gives Hans the first copy. It becomes Hans's first printed tale.
The ballet company has been on tour, but when they return, Doro invites Hans to the premiere of the ballet "The Little Mermaid'. Hans, believing that she is in love with him, is overjoyed, but Peter, who knows the truth (that Doro and Nils enjoy quarreling as a natural part of their married life), tries to reason with Hans, but the shoemaker will not listen and fires Peter. When Hans shows up at the ballet, he insists on giving Doro some new slippers that he made, but Nils, eager to see that everything goes well, angrily locks Hans in the prop room, where he hears, but does not see the ballet. Nils forgets about him and leaves him there all night.
The next morning, Doro is furious when she hears that Hans has been locked up all night, but she is still quite affectionate with her husband. She sends her chambermaid to bring Hans to their apartment. When Hans arrives, Nils leaves them alone to talk. She apologizes to Hans and gently asks him why he wrote the story for her. When he tells her that it was his way of acknowledging that he knew that "she was miserable with her husband", Doro is moved, but not angry. Suddenly Nils returns and from his laughing, jovial demeanor, Hans now realizes that Peter was right and that Nils and Doro are very happily married. She tenderly tells him that she will remember what he told her every time she dances the ballet. As soon as he is gone, Doro embraces Nils, quietly weeping.
Hans leaves Copenhagen and on the way back to his village, runs into Peter. The two reconcile and Hans says "I'm through telling stories, especially with myself'. Peter assures him he will go on telling stories over and over again. We see a montage showing the titles of Hans's most famous stories, which are all eventually published.
In the final scene, we see the now celebrated Hans, surrounded by the children and all the adults (including the schoolmaster) , having even more success than before telling stories.