Gestational diabetes mellitus (GDM) is considered a risk factor for heart metabolic disorder in future mothers and offspring. Ferroptosis is a new type of programmed cell death, which may participate in the occurrence and development of GDM. This study aims to identify ferroptosis-related genes in GDM by bioinformatics methods and to explore their clinical diagnostic value. The dataset GSE103552 was analyzed using the Gene Expression Omnibus (GEO) database to screen for differentially expressed genes (DEGs) in GDM. Gene Ontology (GO) and Kyoto Encyclopedia of Genes and Genomes (KEGG) pathway enrichment analysis and proteinprotein interaction (PPI) network were performed. Gene sets for ferroptosis were retrieved in MSigDB and GSVA gene set analysis was performed on the database. Finally, logistic regression was performed to differentiate between GDM patients and controls to screen for diagnostic markers. A total of 179 DEGs were identified in the expression profile of GDM. GO and KEGG enrichment analysis revealed significant enrichment in the TGF-β, p53 signaling pathway, platelet activation, glutathione metabolism, sensory perception of taste, and leukocyte and vascular endothelial cell migration regulation. DEGs (n = 107) associated with the ferroptosis gene set were screened by GSVA analysis. The screened DEGs for disease and DEGs for ferroptosis scores were intersected and 35 intersected genes were identified. PPI identified two key genes associated with GDM as CCNB2 and CDK1. Wilcox-test showed low expression of CCNB2 and CDK1 in GDM. The area under the ROC curve (AUC) of the CCNB2 and CDK1 prognostic model was 0.822. The genes associated with ferroptosis in GDM were CCNB2 and CDK1, which can be used as valid indicators for the diagnosis of GDM.