Gestational diabetes mellitus (GDM) predisposes pregnant individuals to perinatal complications and long-term diabetes and cardiovascular diseases. We developed and validated metabolomic markers for GDM in a prospective test-validation study. In a case-control sample within the PETALS cohort (GDM n = 91 and non-GDM n = 180; discovery set), a random PETALS subsample (GDM n = 42 and non-GDM n = 372; validation set 1), and a case-control sample within the GLOW trial (GDM n = 35 and non-GDM n = 70; validation set 2), fasting serum untargeted metabolomics were measured by gas chromatography/time-of-flight mass spectrometry. Multivariate enrichment analysis examined associations between metabolites and GDM. Ten-fold cross-validated LASSO regression identified predictive metabolomic markers at gestational weeks (GW) 10-13 and 16-19 for GDM. Purinone metabolites at GW 10-13 and 16-19 and amino acids, amino alcohols, hexoses, indoles, and pyrimidine metabolites at GW 16-19 were positively associated with GDM risk (false discovery rate <0.05). A 17-metabolite panel at GW 10-13 outperformed the model using conventional risk factors, including fasting glycemia (area under the curve: discovery 0.871 vs. 0.742, validation 1 0.869 vs. 0.731, and validation 2 0.972 vs. 0.742; P < 0.01). Similar results were observed with a 13-metabolite panel at GW 17-19. Dysmetabolism is present early in pregnancy among individuals progressing to GDM. Multimetabolite panels in early pregnancy can predict GDM risk beyond conventional risk factors.