Our findings suggest that both pregestational diabetes mellitus and gestational diabetes mellitus are associated with an increased risk of hypospadias in offspring. Further investigations are needed to explore the optimal range of blood glucose during pregnancy that minimizes the risk of congenital malformation in the fetus, as well as to develop more effective measures for glycemic control in pregnant women.