Inspired by the author's own mystical experience, this novel takes us down the paths of alchemy. There are three kinds of alchemist. Some seek the secrets of alchemy for its marvellous results: the philosopher's stone (turns any metal to gold) and the elixir of eternal youth (offers immortality). Others desire only knowledge and wisdom, and others become alchemists during their lives, without defining themselves as such. Our protagonist is of this third type. This young shepherd, who drives his sheep across the plains of Andalucia in search of food and water, has the courage to live his dreams, and abandoning his education he becomes a shepherd to do what he most desires: to travel. Thus, he lives his dream, or 'personal legend'. But life is never still and, his aim achieved, he encounters new challenges. He has a recurring dream: in the pyramids of Egypt, a treasure awaits him. His life linked with the wisdom of nature has taught him that there is a language marking out the path of each man, a love which cares for us and leads us to satisfaction and happiness. This language of the world troubles him, until the desire of his heart wins out and he responds to the call. Arriving in a city where he had been the previous year, he finds a gypsy, who tells him to go in search of the hidden treasure. However, she does not know how to realise the dream, and asks only that he return to give her 10% of the treasure. The boy leaves the tent, ready to abandon the project. He had plans: to find a girl he had met on his previous visit. An unexpected meeting changes all this. A king named Melquisedec approaches him and seems to know how to realise the dream. Thus, the boy finds himself on an adventure he had dismissed. He travels without sheep now, to the desert. He takes two stones, given him by the king, a being which appears in each man's story in different forms, just when they are ready to reject what they most desire. In Africa, he realises that it will not be easy to continue and that he will have difficulties to overcome. He must not give up. He is robbed and left alone without money. Little by little he recovers his spirits: the stones remind him of Melquisedec's blessing, and he is realising his dream: to travel. He decides to wait for God to show him the way prepared for him. He starts work at a glass shop. The owner tells him it will take many years to save up enough to reach Egypt. This is a great blow to the young man, and he decides to save up to return to his own land. During his time at the shop, he discovers that just as dreams can motivate a person, the fear of realising them and no longer having them can paralyse. Thus, when he is ready to leave, he decides not to give in and begins travelling to Egypt.
In the caravan on the way to the desert, he meets an Englishman who is striving to study alchemy with complicated books, and is travelling to the oasis of Al-Fayum in search of an alchemist who will take him on as disciple. In the oasis, they search for the alchemist. Then, he meets Fatima, a woman who reveals to him in her eyes the soul of the world. He knows that he is before the treasure sought by every man. Because we all live under the sun in the hope of meeting that person whom we love, even before we know that they exist. The tribal war traps them in the oasis, and they meet the alchemist, who sends the Englishman to practise what he already knows. The boy, now used to reading the signs, receives a revelation that the oasis will be attacked. Telling the chiefs this, he saves the lives of those living there. It is in that moment that the alchemist approaches him and recognises him as his true disciple. He offers to help him on the final stage of his journey, but now the young man has another reason not to continue: Fatima. However, it is she who asks him to go, because true love never interferes with the path of the loved one. They come across the warring tribes. The alchemist tells them, to the boy's amazement he, the boy, can become the wind, and that he will demonstrate this in exchange for their freedom, otherwise they will die at their captors' hands. Entering into contact with all the elements of nature, he reaches God and achieves this miracle. They arrive at a convent where the alchemist turns some lead into gold. It is divided into four pieces: one for the monk who cared for them, who will keep another piece in case the boy has an emergency, another for the alchemist who will return to the oasis, and another for the young man. Alone, he reaches his destiny, and kneeling he cries. He finds the place to dig, for 'there where the treasure lies will also be your heart'. Finding nothing, he is attacked. One thief laughs at his journey, saying that he had a similar dream: treasure was to be found in the plains of Andalucia. Santiago has found his treasure.