Biological sex is determined before birth through a sequential process: chromosomes establish gonadal sex at fertilization, gonadal hormones drive internal and external genital development in the first trimester, and hormonal signaling organizes the brain and other tissues through late gestation. No single step decides sex; each stage builds on the last, and disruption at any point produces intermediate outcomes. Sex is a developmental pathway assembled over roughly 40 weeks, not a switch flipped at conception.

The process begins when a sperm carrying either an X or a Y chromosome fertilizes an egg, which always carries an X. That single chromosomal difference sets off a cascade of gene expression, hormone production, and tissue remodeling that unfolds across three trimesters. Understanding the sequence explains why biological sex exists on a spectrum of outcomes rather than in two neat categories.

Chromosomal Sex at Fertilization

Every human egg carries one X chromosome. Sperm carry either an X or a Y. When a Y-bearing sperm fertilizes the egg, the resulting zygote has a 46,XY karyotype; an X-bearing sperm produces 46,XX. This moment, roughly 24 hours after ovulation, establishes chromosomal sex. But chromosomes are instructions, not outcomes. For the first several weeks of development, XX and XY embryos are anatomically indistinguishable.

The critical gene is SRY, located on the short arm of the Y chromosome. SRY encodes a transcription factor that initiates testicular development. Without SRY, the bipotential gonad, a structure that can become either a testis or an ovary, follows the ovarian pathway by default. This default is not passive; genes such as FOXL2 and WNT4 actively suppress testicular development in XX gonads. The gonad begins as a paired ridge of tissue called the genital ridge, formed by about week 5 of gestation. By week 6, the gonad is still bipotential. SRY expression peaks around weeks 6 to 7 in XY embryos, triggering the supporting cells to become Sertoli cells.

Sertoli cells are the organizing center of the testis. They produce anti-Müllerian hormone (AMH), which causes the Müllerian ducts (the precursor of the uterus and fallopian tubes) to regress. They also recruit other cells to form Leydig cells, which produce testosterone. In XX embryos, the absence of SRY allows the gonadal ridge to develop into ovaries, with germ cells entering meiosis by about week 12. The ovary does not simply sit idle; it actively produces hormones and organizes follicular structures.

A counterintuitive detail: the Y chromosome carries very few genes, and SRY is the only one directly responsible for sex determination. The rest of the Y is largely involved in spermatogenesis. This means a single gene, acting in a narrow developmental window, determines whether the gonad becomes a testis or an ovary. If SRY expression is delayed or reduced, the gonad may develop as an ovotestis or streak gonad, producing ambiguous outcomes.

Hormonal Sex and Internal Genitalia

Once the gonad forms, its hormonal output determines the internal reproductive tract. In XY embryos, Sertoli cells secrete AMH beginning around week 7. AMH causes the Müllerian ducts to regress through apoptosis over the following two weeks. Leydig cells begin producing testosterone by week 8. Testosterone stabilizes the Wolffian ducts, which become the epididymis, vas deferens, and seminal vesicles. This dual-hormone system, AMH for regression and testosterone for stabilization, is why XY fetuses develop male internal genitalia.

In XX embryos, the absence of AMH allows the Müllerian ducts to persist and develop into the uterus, fallopian tubes, and upper vagina. The Wolffian ducts regress because testosterone is absent. This is not a passive default; the Müllerian ducts require active signaling from genes such as PAX2 and LIM1 to develop properly. Without these signals, even in the absence of AMH, the ducts fail to form.

The timing of hormone exposure matters as much as the hormones themselves. The critical window for internal genital differentiation is approximately weeks 7 to 12 of gestation. If testosterone production begins after this window, Wolffian duct development may be incomplete. If AMH is absent during the window, Müllerian structures persist even in an XY fetus. This is why 46,XY individuals with complete androgen insensitivity syndrome (CAIS) develop a uterus and fallopian tubes: their testes produce AMH, which regresses the Müllerian ducts, but their cells cannot respond to testosterone, so the Wolffian ducts regress. They develop female external genitalia and a short vagina, but no uterus. The internal anatomy is a mix of male and female structures, determined by which hormones were present and which receptors could respond.

One professional caveat: the terms "male" and "female" internal genitalia are descriptions of typical outcomes, not binary categories. The developmental pathways share precursors and overlap in timing.

External Genitalia: The Critical Window

External genitalia develop from a common precursor structure called the genital tubercle, along with the urogenital folds and labioscrotal swellings. In the absence of androgens, these structures develop into the clitoris, labia minora, and labia majora. In the presence of adequate testosterone and its more potent metabolite dihydrotestosterone (DHT), the genital tubercle elongates into the penis, the urogenital folds fuse to form the penile urethra, and the labioscrotal swellings fuse to form the scrotum.

The enzyme 5-alpha-reductase converts testosterone to DHT in the genital tissues. DHT is approximately 10 times more potent than testosterone at the androgen receptor. This amplification is why the external genitalia are exquisitely sensitive to androgen levels during a narrow window: approximately weeks 8 to 14 of gestation. Fusion of the urethral folds is complete by about week 14. If androgen exposure is insufficient or delayed, fusion may be incomplete, resulting in hypospadias, where the urethral opening is on the underside of the penis rather than at the tip. Hypospadias affects approximately 1 in 200 to 1 in 300 male births in the United States (CDC surveillance data).

The timing of androgen exposure also explains why some 46,XY individuals with 5-alpha-reductase deficiency are born with ambiguous or female-appearing genitalia. They produce testosterone, but cannot convert it to DHT efficiently in the genital tissues. At puberty, the surge of testosterone produces virilization, including penile growth and scrotal rugation, because testosterone itself can partially activate the androgen receptor at high concentrations.

A comparison of the major developmental outcomes helps clarify the pathways:

Chromosomal sex Gonadal outcome Internal genitalia External genitalia Key hormonal driver
46,XX Ovaries Uterus, fallopian tubes, upper vagina Clitoris, labia Absence of AMH and testosterone
46,XY Testes Epididymis, vas deferens, seminal vesicles Penis, scrotum AMH, testosterone, DHT
46,XY with CAIS Testes Absent Müllerian structures; no Wolffian structures Female-appearing AMH present; androgen receptors nonfunctional
46,XY with 5-alpha-reductase deficiency Testes Wolffian structures present Ambiguous or female-appearing at birth Testosterone present; DHT low
46,XX with congenital adrenal hyperplasia Ovaries Uterus present Virilized (clitoromegaly, labial fusion) Excess adrenal androgens

This table shows that chromosomal sex, gonadal sex, and anatomical sex can diverge. The divergence is not rare; disorders of sex development (DSDs) occur in approximately 1 in 4,500 births, according to some estimates, though the true prevalence depends on definitions.

Brain and Beyond: Organizational Effects

Hormones organize tissues beyond the reproductive tract. During the second and third trimesters, testosterone and its metabolites influence brain development, though the effects are subtle and not fully mapped. Studies in animals show that androgen exposure during critical periods affects regions such as the sexually dimorphic nucleus of the preoptic area. In humans, the evidence is more circumstantial: brain imaging studies show average differences in某些 regions between males and females, but the overlap is substantial, and the functional significance is debated.

A timeline of key developmental events:

Gestational age Event
Fertilization (week 0) Chromosomal sex established (46,XX or 46,XY)
Week 5-6 Genital ridge forms; gonad is bipotential
Week 6-7 SRY expression initiates testicular development in XY embryos
Week 7-8 Sertoli cells secrete AMH; Leydig cells begin testosterone production
Week 8-12 Internal genitalia differentiate (Müllerian regression or Wolffian stabilization)
Week 8-14 External genitalia differentiate; urethral folds fuse in males
Week 12-16 Fetal testosterone peak in males; ovarian follicles form in females
Second and third trimesters Hormonal effects on brain and other tissues; genital growth continues

Another counterintuitive finding: the fetal adrenal gland, not just the gonad, contributes to sex differentiation. The fetal adrenal cortex produces androgens that can influence genital development, particularly in XX fetuses with congenital adrenal hyperplasia (CAH). In CAH, an enzyme deficiency (most commonly 21-hydroxylase) blocks cortisol synthesis, shunting precursors into the androgen pathway. XX fetuses with CAH are born with virilized external genitalia, ranging from clitoromegaly to complete labioscrotal fusion, despite having ovaries and a uterus. This is why newborn screening for CAH is standard in all US states; early detection prevents salt-wasting crises and allows monitoring of genital development.

When the Pathway Diverges

Disorders of sex development (DSDs) are congenital conditions in which chromosomal, gonadal, or anatomical sex is atypical. They are not rare curiosities; they are natural experiments that reveal the logic of the developmental pathway. The most common categories include:

46,XX DSD, often caused by CAH (excess androgen exposure in an XX fetus). 46,XY DSD, including androgen insensitivity syndrome (CAIS and PAIS), 5-alpha-reductase deficiency, and gonadal dysgenesis. Sex chromosome DSDs, such as Turner syndrome (45,X) and Klinefelter syndrome (47,XXY), which affect gonadal development and hormone production.

Red-flag warnings for clinical practice:

Any newborn with ambiguous genitalia should be evaluated promptly by a multidisciplinary team, including endocrinology, genetics, and urology. Do not assign sex based solely on external appearance; chromosomal and gonadal sex may differ. Monitor for salt-wasting crisis in any infant with suspected CAH; this is a medical emergency. Avoid irreversible surgical procedures on ambiguous genitalia without clear medical necessity and family counseling; current guidelines recommend deferring cosmetic surgery until the patient can participate in decisions.

These warnings reflect a shift in clinical practice over the past two decades. The 2006 consensus statement on DSD management emphasized a multidisciplinary approach and caution against early irreversible surgery. Current guidelines from major pediatric endocrine societies support this stance, though practices vary.

Practical Actions and Thresholds

For expectant parents and clinicians, the practical takeaways are about timing and testing. Noninvasive prenatal testing (NIPT) can detect sex chromosome aneuploidies from maternal blood as early as 10 weeks of gestation, but it is a screening test, not a diagnostic one. Cell-free DNA testing analyzes placental DNA, not fetal DNA directly, and can be confounded by placental mosaicism. Confirmatory testing requires amniocentesis (typically performed between 15 and 20 weeks) or chorionic villus sampling (10 to 13 weeks).

Ultrasound can sometimes visualize fetal genitalia by 14 to 16 weeks, but accuracy depends on fetal position, equipment, and operator skill. The "nub theory," which uses the angle of the genital tubercle to predict sex, is not reliable before 12 weeks and is not a diagnostic tool. Do not rely on ultrasound alone for sex determination; it has a false-positive rate that varies by gestational age and technique.

For parents of a child with a DSD diagnosis, concrete steps include:

Request a karyotype and, if needed, chromosomal microarray to establish chromosomal sex. Obtain hormone panels (testosterone, AMH, adrenal androgens) to assess gonadal and adrenal function. Consult a pediatric endocrinologist and a genetic counselor before making any decisions about sex assignment or surgery. Connect with peer support organizations that specialize in DSD conditions; they can provide perspective that clinical teams cannot. Monitor for metabolic complications, particularly salt-wasting in CAH, which can present in the first two weeks of life.

What the Evidence Cannot Yet Explain

The mechanisms described above are well established, but several questions remain open. The precise contribution of prenatal hormones to human brain organization is not fully known; animal models provide clues, but human studies are limited by ethical constraints and the difficulty of separating prenatal from postnatal influences. The role of epigenetic modifications, such as DNA methylation, in sex-specific gene expression is an active area of research. And the long-term outcomes of different management approaches for DSD conditions are still being studied; the evidence base for surgical timing and technique is not as robust as clinicians would like.

A final professional caveat: biological sex is not a single variable. Chromosomal sex, gonadal sex, hormonal sex, and anatomical sex are distinct layers that usually align but can diverge. The developmental sequence is robust but not deterministic; each step depends on the previous one, and each step can be modulated by genetic variation, environmental factors, and chance. That is why the question "how is biological sex determined before birth" has a mechanistic answer but not a simple one. The answer is a sequence, not a switch, and the sequence is still being mapped.