23- Does a boy become a girl, or a girl become a boy?
Doing this is not within the power of any of the creation, nor is it in their control, however lofty their knowledge and claims to learning may be. This is the work of Allah alone, who has no partner. Allah the Exalted says:
لِلَّهِ مُلْكُ السَّمَاوَاتِ وَالْأَرْضِ يَخْلُقُ مَا يَشَاءُ يَهَبُ لِمَنْ يَشَاءُ إِنَاثًا وَيَهَبُ لِمَنْ يَشَاءُ الذُّكُورَ أَوْ يُزَوِّجُهُمْ ذُكْرَانًا وَإِنَاثًا وَيَجْعَلُ مَنْ يَشَاءُ عَقِيمًا إِنَّهُ عَلِيمٌ قَدِيرٌ
“To Allah belongs the kingdom of the heavens and the earth; He creates whatever He wills. He grants daughters to whomever He wills and grants sons to whomever He wills. Or He joins them together, sons and daughters, and He makes whomever He wills barren. Indeed, He is All-Knowing, All-Powerful.”
At the beginning of this verse, Allah the Exalted made clear that it is My prerogative alone whether I make a boy or a girl, and at the end of the verse He also stated the reason for this distinction: that it is the result of perfect knowledge and power. It is certainly the case that some children are such that, at birth, it is difficult to recognize whether it is a girl or a boy. In most of them it becomes known as soon as they reach puberty, but if a situation arises in which no sign appears, then the truth is determined by opening the way through an operation. In such a case, it is not the achievement of any doctor or physician that he has turned a girl into a boy; rather, he has only opened the way to the sex that had already been determined by the Master of all dominion. And Allah knows best.