The most common way to tell if a baby will be male or female before it’s born is by an ultrasound at or after 18-20 weeks of gestation. An ultrasound is a medical procedure that takes a picture of the baby in the uterus. This picture shows the genitals (if the baby is in the right position). People can ask what the sex of a baby is if they want to know.