BackgroundDietary-induced inflammation is potentially associated with sarcopenia. Nevertheless, few studies have investigated the structure of the inflammatory diet and its correlation with muscle function and performance in both the upper and lower limbs. This study was performed to explore the association of the dietary inflammatory index (DII) with sarcopenia and its diagnostic parameters.MethodsWe conducted a cross-sectional survey on a sample of 515 Chinese community-dwelling older adults selected through multistage cluster sampling from three districts in Shanghai. DII scores were calculated using a validated food frequency questionnaire. Sarcopenia and its diagnostic parameters were determined based on the definition set by the Asian Working Group on Sarcopenia (AWGS).ResultsThe mean age of study participants was 71.31 ± 4.71 years. The prevalence of sarcopenia in the cohort was 12.4%. Older adults in the highest DII quartile had a 3.339 times increased risk of sarcopenia compared to those in the lowest quartile (ORQuartile4vs1:3.339, 95%CI: 1.232, 9.052,p-trend: 0.004) after adjusting for confounding factors. Additionally, a more pro-inflammatory diet was associated with lower appendicular skeletal muscle index (ASMI) (ORQuartile4vs1: 3.005, 95%CI: 1.275, 7.318,p-trend: 0.005), a higher 5-times sit-stand test time score (ORQuartile4vs1: 4.942, 95%CI: 1.745, 13.993,p-trend: 0.005), and lower gait speed (ORQuartile4vs1: 2.392, 95%CI: 1.104, 5.185,p-trend: 0.041) after adjusting for confounding factors. However, there was no significant association between DII, handgrip strength, and Short Physical Performance Battery (SPPB) score in either the unadjusted or adjusted model.ConclusionThis study found that the association between consuming a more pro-inflammatory diet and sarcopenia in Chinese community-dwelling older adults was mainly due to underlying low intakes of dietary energy, protein, and anti-inflammatory foods, and not due to the high intake of pro-inflammatory foods. Meanwhile, DII was more highly correlated with lower limb muscle strength and performance compared to upper limb muscle strength.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12877-023-03938-7.