ObjectiveTo explore the association between the Diet Inflammatory Index (DII) and infertility.DesignMultivariable logistic regression was performed to investigate the relationship between infertility and DII, and restricted cubic spline was utilized to test for nonlinear relationships in this cross‐sectional study.SettingData of this study was collected from the 2013 ‐ 2020 National Health and Nutrition Examination Survey (NHANES) database.ParticipantsA total of 2066 women aged 20‐45 years were enrolled in this study considering women's child‐bearing age.ResultsAfter adjusting for all covariates, a positive association was found between DII score and odds of infertility by multivariable logistic regression (odds ratio = 1.19, 95% confidence interval 1.03, 1.38; P = 0.027). Compared with participants with DII scores in the lowest quartile, those with DII scores in the highest quartile had significantly higher odds of infertility (odds ratio = 2.42, 95% confidence interval 1.09, 5.34; P = 0.034). The restricted cubic splines model suggested a linear relationship between DII and infertility (P for nonlinear = 0.1827).ConclusionsA positive association between a pro‐inflammatory diet and self‐reported infertility was detected. Our study extends the application of the DII scoring system to infertility prevention.This article is protected by copyright. All rights reserved.