When can An Ultrasound Detect Gender?

An ultrasound can usually detect the gender of a baby at between 16 and 20 weeks pregnant. However, there are factors like the positioning of the baby that can prevent gender detection. My daughter was hiding throughout my whole pregnancy so she was a surprise!