BackgroundTo investigate the association between the Dietary Inflammatory Index (DII) and all-cause mortality in patients with osteoarthritis (OA).MethodsIn this retrospective cohort study, data on OA patients were obtained from the National Health and Nutrition Examination Survey (NHANES) 2003–2018. OA diagnosis was self-reported. The study population was divided into low and high DII groups based on the DII’s median. All-cause mortality was the outcome, which was determined via linkage to the National Death Index (NDI) until 31 December 2019. Multivariable Cox regression analyses were employed to investigate the association between the DII and all-cause mortality. The survival of the low and high DII groups was exhibited by Kaplan–Meier curves. Furthermore, subgroup analyses were carried out in terms of age and comorbidity.ResultsA total of 3804 patients with OA were included, with 1902 (50%) in the low DII group and 1902 (50%) in the high DII group. Patients with a high DII had a significantly greater risk of all-cause mortality than those with a low DII (HR = 1.21, 95%CI: 1.02–1.44, P = 0.025). A high DII was associated with a significantly increased risk of all-cause mortality compared with a low DII in patients aged ≥ 65 years [hazard ratio (HR) = 1.28, 95% confidence level (CI): 1.07–1.53, P = 0.006). Hypertensive patients with a high DII had a significantly greater risk of all-cause mortality than those with a low DII (HR = 1.25, 95%CI: 1.03–1.52, P = 0.025). For patients with cardiovascular disease (CVD), a high DII was associated with a significantly higher risk of all-cause mortality than a low DII (HR = 1.43, 95%CI: 1.17–1.75, P < 0.001). A high DII was associated with a significantly greater risk of all-cause mortality, as compared with a low DII in patients with chronic kidney disease (CKD) (HR = 1.22, 95%CI: 1.02–1.45, P = 0.026).ConclusionThe DII was positively associated with the risk of all-cause mortality in patients with OA. This association differed by age, hypertension, CVD, and CKD. Adherence to diet with a low DII may be beneficial in prognosis improvement.