ObjectivesThis study aims to investigate the association of physical activity (PA) and sedentary behaviour (SB) with chronic kidney disease (CKD), and to illustrate whether inflammatory biomarkers play a mediating role.DesignA cross-sectional study.SettingThis study analysed cross-sectional data from the National Health and Nutrition Examination Survey 2007–2018.ParticipantsA total of 27 808 participants aged 20–80 years old were enrolled in the final analysis.Outcome measuresPA and SB were self-reported by participants using the Global Physical Activity Questionnaire. Inflammatory biomarkers including neutrophil/lymphocyte ratio (NLR), platelet/lymphocyte ratio (PLR) and systemic immune inflammation index (SII) were examined in subjects’ peripheral blood samples. Estimated glomerular filtration rate <60 mL/min/1.73 m2was defined as CKD. Multivariable logistic regression and medication model were performed to examine the associations of PA, SB and inflammatory biomarkers with CKD.ResultsPA was associated with CKD, with a 20% lower OR of CKD compared with inactive (p=0.002) and a 2% lower OR per 30 min moderate-to-vigorous PA increase (p=0.027). SB was also associated with CKD, with a significant 39% higher OR for high SB (p<0.001), and a 3% higher OR per 30 min SB increase (p<0.001). NLR and SII both significantly mediated the association of PA and SB with CKD. NLR explained 1.87% (medication effect: −0.0003, direct effect: −0.0162) and 2.73% (medication effect: 0.0005, direct effect: 0.0192) association of PA and SB with CKD (p<0.001), respectively. While SII explained 1.77% (medication effect: −0.0003, direct effect: −0.0162) and 1.22% (medication effect: 0.0002, direct effect: 0.0199) association of PA and SB with CKD (p<0.001), respectively. The results did not show any statistical association between PLR and CKD in this sample.ConclusionThis finding revealed increasing PA and shortening SB may be effective strategies in CKD prevention and early management through the regulation of systemic inflammation. NLR and SII may not only be prognostic indicators of CKD, but also novel potential markers in predicting CKD occurrence.