Studies indicate a link between the presence of various heavy metals and the development of insulin resistance. We sought to evaluate the association between the levels of certain urinary metals, including barium, cadmium, lead, molybdenum, strontium, uranium, and others, with the incidence of diabetes. The prevalence of diabetes was assessed by retrieving and analyzing the health questionnaire for patients data from NHANES 2013 to 2018. We observed that urinary barium (β = 0.04 95% CI: 0.01, 0.1), urinary strontium (β = 0.04 95% CI: 0.01, 0.1) and urinary uranium (β=-0.02 95% CI: -0.04, 0.004) were positively correlated with the risk of developing diabetes. In addition, consistent trends were maintained in quantile regression models. After adjusting for covariates (sex, age, education level, race, BMI, income, and heavy metals) for the associations of urinary and blood heavy metals with the risk of developing diabetes (β = 0.03, 95% CI: -0.06, 0.11), urinary strontium (β = 0.00) and urinary uranium (β = 0.10, 95% CI: -0.22, 0.43) showed linear relationships with the risk of developing diabetes. The role of mixed heavy metal exposure was evaluated using weighted quantiles and a weighted quantile sum (WQS) model. According to the WQS analysis, a mixed exposure was substantially positively associated with the chance of acquiring diabetes (β = 1.02, 95% CI: 1.01, 1.03). Therefore, our research showed that there were positive correlations of strontium and uranium with the prevalence of diabetes, and strontium also had a substantial impact on mixed heavy metal exposure, which causes serious harm to the human body.