As the Bible was written before most surgeries were even possible, it does not mention getting a sex change. It does, however, speak of people taking on the appearance of someone in the opposite gender.
Sex change – Is it biblical to get one?
Deuteronomy 22:5 says, "A woman shall not wear a man's garment, nor shall a man put on a woman's cloak, for whoever does these things is an abomination to the LORD your God." One way we can tell if an Old Testament law is valid in the church age is to see if the law was repeated in the New Testament. In 1 Corinthians 11:14-15, Paul explains that men and women should not wear their hair in such a way that their gender is indistinguishable. It is unbiblical to dress as someone of the opposite gender.
First Corinthians 6:9 in the New American Standard Bible says that those who are effeminate will not inherit the kingdom of God—they will not experience God's sovereignty, blessing, and power in this life. "Effeminate" is the Greek malakos. It refers to a boy kept for homosexual relations with a man, as was common in Greece and Rome. One of the primary purposes of a man getting a sex change operation is to be physically altered to do just this.
It should be noted that some seekers of a sex change surgery have a condition known in the psychological world as Gender Dysphoria. This is characterized by an imbedded sense that one's physical sex does not match his or her experienced gender. While the sex organs are not ambiguous in such individuals, it is possible that there is something physically different in their brains. The actual amount of people with this condition has not been well-studied, but estimates are well under 0.2% percent, and may even be as low as 0.003%, of the population. Some of these people seek a surgical change when they feel their only other option is to die. However, other seekers of sex changes may be confused about their sexuality due to childhood trauma, cultural influence, desire to be sexually deviant, or something else. For those with true Gender Dysphoria, it would seem that it could be biblically acceptable to seek surgical intervention, such as those with an intersex condition (having a mixture of male and female sexual characteristics) or some other surgically-reparable birth defect. However, for those seeking a sex change for some other reason, it is clearly unbiblical.
Genesis 1:27 says, "So God created man in his own image, in the image of God he created him; male and female he created them." There is something important to God about both genders. He purposely created them to be distinct and yet to be unified through marriage. Both male and female reflect God individually and together. Our current culture is obsessed with sexuality and entrenched in a desperate post-modern search for meaning where everyone does what feels right. Part of the search for meaning has included questioning gender and its validity. But gender issues are nothing new. Gender relations and human identity broke down with the Fall in Genesis 3. Changing one's sex as a way of subverting God's original design is wrong.
Psalm 139:13-16 says, "For you formed my inward parts; you knitted me together in my mother's womb. I praise you, for I am fearfully and wonderfully made. Wonderful are your works; my soul knows it very well. My frame was not hidden from you, when I was being made in secret, intricately woven in the depths of the earth. Your eyes saw my unformed substance; in your book were written, every one of them, the days that were formed for me, when as yet there was none of them." Our creation is specific and meaningful. God has a plan for our lives. Some may experience a sort of birth defect due to the general results of sin in our world. Others may experience distress at the hand of someone else's sin or due to cultural noise. God is sovereign and faithful in all of it. Anyone considering a sex change should first check their heart posture before God. Then ask Him to guide and seek professional care. A sex change is likely not the answer. And even if it is part of the answer, never forget that only God provides true healing.
What does the Bible say about eunuchs?
Does the Bible talk about asexuality?
What is a biblical view of prejudice, descrimination, and racism?
Why did God create humanity?
What does it mean that humanity is created in the image of God?