Abstract
BACKGROUND: Although previous studies have evaluated the association between the Dietary Index for Gut Microbiota (DI-GM) and kidney stone formation, highlighting the potential role of diet-modulated gut microbiota in urolithiasis; however, the underlying mechanisms remain unclear. In particular, the mediating role of body mass index (BMI) in the relationship between DI-GM and kidney stone risk has not yet been thoroughly investigated. METHODS: This cross-sectional study used data from the National Health and Nutrition Examination Survey (NHANES) spanning 2007–2018. We applied weighted multivariable logistic regression models, restricted cubic spline (RCS) analysis, and subgroup analyses to examine the relationship between DI-GM and kidney stones. Additionally, mediation analysis was conducted to evaluate the potential role of BMI. RESULTS: The present study comprised a total of 29,988 participants, of whom 2,852 had a history of kidney stones. Fully adjusted model demonstrated an inverse association of DI-GM with kidney stones (odds ratio = 0.96, 95% CI: 0.93–0.99, P = 0.004). RCS analysis indicated a non-linear association (P for non-linearity < 0.001). Mediation analysis estimated that BMI accounted for 9.8% of the total effect of DI-GM on kidney stones risk. CONCLUSION: While prior studies have demonstrated a link between DI-GM and kidney stones, our findings extend this knowledge by identifying BMI as a significant mediator of this relationship. These results provide new insights into the potential pathways linking diet, gut microbiota, body weight, and kidney stone risk. Further longitudinal studies are needed to confirm these findings and clarify causal relationships. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1186/s12889-025-24292-w.