You can find out the sex of a baby before birth in three main ways: cell-free DNA screening from a blood draw as early as 10 weeks of pregnancy, chorionic villus sampling at about 10 to 13 weeks, or an anatomy ultrasound around 18 to 22 weeks. None of these methods is perfectly accurate, and each reveals sex — chromosomal sex — rather than the fuller concept of gender, which is a personal identity rather than a fetal measurement.

This distinction matters more than most thin explainers admit. What prenatal tests actually detect is biological sex markers: chromosomes, hormones, and anatomy. Gender identity is a lived, internal experience that cannot be measured in a fetus. The tests below are also screening tools with specific error rates, not crystal balls. Understanding the biology behind each test explains why timing varies so widely.

How fetal sex development actually unfolds

Every embryo starts with a pair of undifferentiated gonads and two duct systems. Around week 6 to 7, the SRY gene on the Y chromosome typically triggers testosterone production, which drives the Wolffian ducts toward male development. Without that signal, the Müllerian ducts develop into female structures. External genitalia begin forming around week 9 and are not fully differentiated until roughly week 14. In plain terms, the fetus is building the hardware before any imaging can reliably see it.

Chromosomal sex exists from the moment of conception. A sperm carrying an X or Y chromosome determines the complement at fertilization. But biology has a wrinkle: circulating cell-free DNA from the placenta (not the fetus directly) enters the pregnant person's blood. That is why a blood test can read fetal sex chromosomes long before anatomy forms. The biology, not the test, sets the earliest possible detection date.

This sequencing explains the timelines you will see below. Each test targets a different layer of that process — genetics first, then hormones, then visible structure — and the calendar follows the mechanism.

Diagnostic routes and their timing

Each method interrogates a different biological signal, so its accuracy window depends on when that signal becomes measurable.

Method Earliest reliable timing What it measures Typical accuracy Miscarriage risk
Cell-free DNA (NIPT) 10 weeks Placental DNA in maternal blood Roughly 99% for sex chromosomes when fetal fraction is adequate None (blood draw)
Ultrasound ("nub" theory) 12–14 weeks Genital tubercle angle Lower and operator-dependent at this stage None
Detailed anatomy scan 18–22 weeks Visible external genitalia High, operator-dependent None
Chorionic villus sampling (CVS) 10–13 weeks Placental tissue chromosomes Very high (diagnostic) Small, roughly 0.2–1% above background
Amniocentesis 15–20 weeks Amniotic fluid cells Very high (diagnostic) Small, roughly 0.1–0.3% above background

Timing figures reflect widely used obstetric conventions. NIPT typically requires a minimum fetal fraction — often around 4% — before it returns a call; below that, labs report "no result" rather than a guess.

A week-by-week timeline

Gestational week What is happening What testing can reveal
Weeks 1–5 Fertilization; chromosomes set Nothing testable prenatally
Week 6–7 Undifferentiated gonads; SRY may activate Nothing visible
Week 9–10 External genitalia forming; free fetal DNA rising NIPT may be offered (from 10 weeks)
Weeks 10–13 Genital structures differentiating CVS can be performed
Weeks 12–14 Nub theory window; genitalia partially formed Ultrasound clues, not definitive
Weeks 15–20 Anatomy maturing Amniocentesis window
Weeks 18–22 External genitalia clearly visible Standard anatomy ultrasound
Third trimester Anatomy well established Confirmatory imaging if earlier results unclear

Notice that the two most common routes bracket the pregnancy: a first-trimester blood test and a mid-pregnancy ultrasound. The gap between them is roughly 8 to 12 weeks of waiting.

Orders of magnitude: accuracy, error, and why numbers differ

Headline accuracy figures are conditional, which thin explainers rarely state. NIPT sex accuracy is high — often quoted near 99% — but it degrades when fetal fraction is low, when the pregnancy started as twins with a vanished one, or when the pregnant person's own chromosomal patterns interfere. An ultrasound's accuracy depends heavily on fetal position, maternal body habitus, and sonographer skill.

There is a counterintuitive detail worth flagging: NIPT can be wrong in ways that look like the opposite sex. If the placenta carries a chromosome pattern different from the fetus (confined placental mosaicism), the blood test reads the placenta. In rare cases, the test can also signal a maternal chromosomal finding the family did not expect. A board-certified genetic counselor can interpret discordances far better than an internet calculator.

Diagnostic tests (CVS, amniocentesis) analyze actual fetal cells and are near-definitive for chromosomal sex. But they carry a small procedure-related loss rate. That is why they are usually ordered for genetic risk reasons, not sex curiosity alone.

Red flags to watch for

A "no result" or low-fetal-fraction NIPT is not a boy or girl answer; it is a failed test requiring repeat or diagnostic follow-up. Fetal sex predicted by a kit sold online without a clinician involved deserves deep skepticism; regulatory status varies. Discordance between a blood test and an ultrasound is a medical finding, not a coin flip — ask for genetics referral. Bleeding, cramping, or fever after CVS or amniocentesis needs urgent obstetric care. Sex disclosure at a 12-week "nub" ultrasound is a prediction, not a diagnosis; treat it accordingly.

Practical actions and thresholds

Ask about NIPT at your first-trimester visit if it is medically appropriate; wait until at least 10 weeks to avoid a low-fetal-fraction failure. Schedule the anatomy scan between 18 and 22 weeks and confirm it includes sex assessment if you want it. If an early ultrasound is for nub theory, treat any answer as provisional and expect confirmation later. Request genetic counseling for any discordance between tests rather than repeating the test that agrees with you. Decide in advance whether you want sex revealed, and tell the sonographer so it is documented. Note that some regions restrict sex disclosure by law; check local policy before booking.

Thresholds differ by clinic and lab; reconcile them by asking your own provider which cutoffs they use for fetal fraction and repeat testing.

Why limitations and ambiguity remain

Three problems bound all of this. First, chromosomal sex is not gender; the test answers a narrower question than families often hear. Second, screening thresholds are guidelines, not guarantees — a 99% accurate screen still produces false results at scale across millions of pregnancies. Third, prediction timing depends on fetal biology, maternal factors, and equipment, none of which any calculator can fully model. Early certainty is a marketing promise, not a clinical one.

Sex-chromosome differences also exist beyond XX and XY — including varying patterns that standard screens may not report. That is a conversation for a specialist, not a symptom search.

For medical questions about testing timing, results, or discordant findings, this article is general educational information, not a diagnosis or treatment plan, and it does not promise outcomes. Prenatal decisions belong with a qualified local obstetrician or genetic counselor; for urgent symptoms, contact local emergency or obstetric services immediately.