Gestational diabetes mellitus (GDM) is a frequent complication of pregnancy. The specific mechanisms underlying GDM have not yet been fully elucidated. Contemporary research indicates a potential association between liver enzyme irregularities and an increased risk of metabolic disorders, including diabetes. The alanine aminotransferase (ALT) level is recognized as a sensitive marker of liver injury. An increase in ALT levels is hypothesized to be linked to the pathogenesis of insulin resistance and diabetes. Nonetheless, the definitive causal link between ALT levels and GDM still needs to be determined. This investigation utilized two-sample Mendelian randomization (MR) to examine the genetic causation between alanine aminotransferase (ALT) and GDM. We acquired alanine aminotransferase (ALT)-related GWAS summary data from the UK Biobank, Million Veteran Program, Rotterdam Study, and Lifeline Study. Gestational diabetes data were obtained from the FinnGen Consortium. We employed various MR analysis techniques, including inverse-variance weighted (IVW), MR Egger, weighted median, simple, and weighted weighting. In addition to MR-Egger intercepts, Cochrane’s Q test was also used to assess heterogeneity in the MR data, and the MR-PRESSO test was used to assess horizontal pleiotropy. To assess the association’s sensitivity, a leave-one-out approach was employed. The IVW results confirmed the independent risk factor for GDM development, as indicated by the ALT level (p = .011). As shown by leave-one-out analysis, horizontal pleiotrophy did not significantly skew the causative link (p > .05). Our dual-sample MR analysis provides substantiated evidence of a genetic causal relationship between alanine aminotransferase (ALT) levels and gestational diabetes.