As part of the routine tests for pregnant women the doctors in US suggest Ultrasound; to monitor the health of the baby. The test (Ultrasound) can also reveal the sex of the baby, is it permissible to know the sex of the baby before birth?
According to our understanding, a sensor is placed on the abdomen of a
female and the picture of the womb is reflected on the screen.
If so, it is prohibited for a female to unnecessarily reveal her entire or
part of her body to a male physician / gynaecologist. If the scan was
conducted by a female, then it is not prohibited. As regards knowing the
gender of the child through the scan, it is not prohibited. However,
experience have revealed that the information is not always correct. That
can be very disturbing to parents.
and Allah Ta’ala Knows Best
Mufti Ebrahim Desai