Background: Type 2 diabetes mellitus (T2DM), which has a high incidence and several harmful consequences, poses a severe danger to human health. More research is being done on ferroptosis’ function in T2DM. This study uses a bioinformatics technique to look for new diagnostic T2DM biomarkers associated with ferroptosis. Methods: In order to identify ferroptosis-related genes (DEGs) that are differently expressed between T2DM patients and healthy individuals, we first obtained T2DM sequencing data and ferroptosis-related genes (FRGs) from the Gene Expression Omnibus (GEO) database and FerrDb database. Then, drug-gene interaction networks and ceRNA networks linked to the marker genes were built after marker genes were filtered by two machine learning algorithms (LASSO and SVM-RFE algorithms). Finally, to confirm the expression of marker genes, the GSE76895 dataset was utilized. The protein expression of some marker genes between T2DM and non-diabetic tissues was also examined by Western Blotting, Immunohistochemistry (IHC) and Immunofluorescence (IF), respectively. Results: We obtained 58 DEGs associated with ferroptosis. GO and KEGG enrichment analysis showed that these DGEs were significantly enriched in hypoxia and ferroptosis. Subsequently, eight marker genes (SCD, CD44, HIF1A, BCAT2, MTF1, HILPDA, NR1D2 and MYCN) were screened by LASSO and SVM- RFE machine learning algorithms, and a model was constructed based on these eight genes. These newly discovered marker genes may be linked to alterations in the immune microenvironment in T2DM patients. In addition, based on these 8 genes, we obtained 48 drugs and a complex ceRNA network map. Finally, Western Blotting, IHC and IF results of clinical samples further confirmed the results of public databases. Conclusions: The diagnosis and etiology of T2DM can be greatly aided by eight ferroptosis-related genes, opening up novel therapeutic avenues.