The standard method to identify the gender of a baby is an ultrasound between weeks 16 and 20 of pregnancy, according to Baby Center. Though health assessment is the primary motive of a mid-pregnancy ultrasound, the baby's penis or vulva is normally well-developed by this point.
In some cases, parents request not to know the gender until birth. The position of the baby during the ultrasound may also prevent certain identification. It is often easier to identify a male baby because the penis protrudes from the body. If this feature isn't observed, doctors may say that they are uncertain of gender. CVS or amniocentesis tests, sometimes used to detect genetic risks, may also reveal gender.