The present study utilized the National Health and Nutrition Examination Survey (NHANES) database to examine the relationship between serum levels of heavy metals and Diabetic retinopathy (DR) in individuals aged over 30 years with type 2 diabetes mellitus (T2DM) in the United States. A cross-sectional analysis was conducted on 1583 individuals with T2DM from the NHANES 2011–2020, including 331 individuals in the DR group and 1252 individuals in the non-DR group. We collected data on serum levels of heavy metals, DR, and serum albumin for descriptive statistics, linear regression, and logistical regression analysis. After adjusting for age, gender, race and other factors, there was no statistically significant association between blood cadmium, selenium, mercury, or lead and DR. However, serum manganese (Mn) and DR had a significant negative association (β = − 0.2045, 95% CI = − 0.3484, − 0.0606). Serum albumin partially modulated the indirect influence of serum Mn on the incidence of DR, accounting for 12.80% of the association between serum Mn and DR. There was a negative association between serum Mn levels and the prevalence of DR in people with T2DM. Mn intake at least in this study has a little influence on the onset and development of DR.