Gestational diabetes mellitus (GDM) affects 3–14% of pregnancies, with 20–50% of these women progressing to type 2 diabetes (T2D) within 5 years. This study sought to develop a metabolomics signature to predict the transition from GDM to T2D. A prospective cohort of 1,035 women with GDM pregnancy were enrolled at 6–9 weeks postpartum (baseline) and were screened for T2D annually for 2 years. Of 1,010 women without T2D at baseline, 113 progressed to T2D within 2 years. T2D developed in another 17 women between 2 and 4 years. A nested case-control design used 122 incident case patients matched to non–case patients by age, prepregnancy BMI, and race/ethnicity. We conducted metabolomics with baseline fasting plasma and identified 21 metabolites that significantly differed by incident T2D status. Machine learning optimization resulted in a decision tree modeling that predicted T2D incidence with a discriminative power of 83.0% in the training set and 76.9% in an independent testing set, which is far superior to measuring fasting plasma glucose levels alone. The American Diabetes Association recommends T2D screening in the early postpartum period via oral glucose tolerance testing after GDM, which is a time-consuming and inconvenient procedure. Our metabolomics signature predicted T2D incidence from a single fasting blood sample. This study represents the first metabolomics study of the transition from GDM to T2D validated in an independent testing set, facilitating early interventions.