Background Diabetes mellitus (DM) has emerged as a significant component of the global health crisis, closely linked with anemia. Studies have demonstrated a connection between anemia and inflammation. The Dietary Inflammatory Index (DII) is a novel metric for evaluating the overall inflammatory or anti-inflammatory impact of dietary intake. While risk factors for DM are linked to an unhealthy diet, there is currently insufficient research regarding the correlation between DII and anemia among individuals with DM. This study aims to investigate the correlation between DII and anemia among American individuals with DM. Methods This study utilized data from the National Health and Nutrition Examination Survey (NHANES) database, encompassing 4,435 participants recorded between 2007 and 2016. We conducted a weighted multivariable logistic regression analysis to investigate the correlation between the DII and anemia of individuals with DM. Furthermore, we explored their relationship through subgroup analysis and smooth curve fitting techniques. Results This study comprised 726 participants with DM who were anemic and 3,709 who were non-anemic; notably, anemic participants exhibited elevated DII scores (2.05 ± 1.50 vs. 1.70 ± 1.59). In the fully adjusted model, we noted a positive correlation between the DII and anemia (Odds Ratio [OR] = 1.09, 95% Confidence Interval [CI] =1.03 to 1.16, p = 0.004). Participants in the fully adjusted model had a 9% higher prevalence of anemia for each unit increase in DII. The significant association between anemia and DII persisted even after subgroup analysis. Smooth curve fitting analysis revealed a positive correlation between DII and anemia. Conclusion There is a positive correlation between DII and anemia in individuals with DM in the United States. It provides important insights into dietary management strategies for diabetic patients with anemia.