Like Nesbit's The Railway Children, the story begins when a group of children move from London to the countryside of Kent. While playing in a gravel pit the five children – Robert, Anthea, Cyril, Jane and their baby brother, known as the Lamb – uncover a rather grumpy, ugly and occasionally malevolent Psammead or sand-fairy, who has the ability to grant wishes. He persuades the children to take one wish each day to be shared among them, with the caveat that the wishes will turn to stone at sunset. This, apparently, used to be the rule in the Stone Age, when all children wished for was food, the bones of which then became fossils. However, when the five children's first wish, to be "as beautiful as the day", ends at sunset, its effects simply vanish, leading the Psammead to observe that some wishes are too fanciful to be changed to stone.
All the wishes go comically wrong. When the children wish to be beautiful the servants do not recognise them and shut them out of the house. When they wish to be rich they find themselves with a gravel-pit full of gold spade guineas that no shop will accept as they are no longer in circulation, so they can't buy anything. A wish for wings seems to be going well, but at sunset the children find themselves stuck on top of a church bell tower with no way down, getting them into trouble with the gamekeeper who must take them home (though this wish has the happy side-effect of introducing the gamekeeper to the children's housemaid, who later marries him). After being bullied by the baker's boy Robert wishes that he was bigger, whereupon he becomes eleven feet tall and the other children show him at a travelling fair for coins. They also wish themselves into a castle, only to learn that it is being besieged, while a wish to meet real Red Indians ends with the children nearly being scalped.
The children's infant brother, the Lamb, is the victim of two wishes gone awry. In one, the children become annoyed with tending for their brother and wish that someone else would want him, leading to a situation where everyone wants the baby, and the children must fend off kidnappers and Gypsies. Later they wish the baby would grow up faster, causing him to grow all at once into a selfish, smug young man who promptly leaves them all behind.
Finally the children accidentally wish that they could give a wealthy woman's jewellery to their mother, causing all the jewellery to appear in their home. When it seems that the gamekeeper, who is now their friend, will be blamed for robbery the children must beg the Psammead for a complex series of wishes to set things right. It agrees, on the condition that they will never ask It (meaning himself) for another wish. Only Anthea, who has grown close to It, makes sure that the final wish is that they will meet It again. The Psammead assures them that this wish will be granted.