<h4>Objective</h4>To investigate the role of early pregnancy thyroid function in gestational diabetes mellitus (GDM) development and its influencing factors.<h4>Methods</h4>This large-scale retrospective cohort study assessed the associations between early pregnancy thyroid hormones and GDM subtypes, as well as their non-linear relationship with oral glucose tolerance test (OGTT) glucose levels, using multivariate logistic regression and restricted cubic spline models. The gene discussed is TG; the disease is gestational diabetes.