BACKGROUND: The Inflammatory Load Index (IBI) and Body Roundness Index (BRI) were employed to evaluate the systemic inflammatory status and body fat. This study aims to elucidate the association between IBI and the prevalence of gallstones, as well as to analyze the mediating role of BRI in this association. METHODS: Data from the National Health and Nutrition Examination Survey (NHANES) (2017-2020) were utilized in our cross-sectional study. A total of 2598 participants aged ≥ 20 years were enrolled. The Boruta algorithm, a supervised classification feature selection method, is leveraged to identify the confounding variables most strongly associated with the prevalence of gallstones. Weighted multivariate logistic regression, restricted cubic splines (RCS), and subgroup analyses were employed to investigate the association between IBI and gallstones, assess the presence of a linear association, and evaluate the effect of IBI on gallstone risk across different populations. Finally, the mediating effect of BRI was examined. RESULTS: In the fully adjusted model, when IBI was in the highest tertile, each unit increase in IBI (corresponding to an increase of 1 in the natural logarithm of IBI) was linked to a 110.8% higher prevalence of gallstones (OR = 2.108, 95% CI: 1.109-4.005
P = 0.028). The odds ratio for gallstones increased with higher IBI levels across unadjusted, partially adjusted, and fully adjusted models (P for trend <
0.05). This positive association was confirmed to be linear by the RCS curve (P for nonlinear = 0.887). Subgroup analysis indicated that the risk of gallstones was significantly elevated in individuals aged ≥ 60, females, and those with a Poverty-to-Income Ratio (PIR) ≥ 2 (P <
0.05). Mediation analysis revealed that IBI had a significant indirect effect on gallstone prevalence through BRI, with an effect size of 0.0129 (95% CI: 0.0121-0.0136
P <
0.001), and the mediation contributed to 33.24% of the total effect. CONCLUSIONS: This study demonstrates a significant linear positive relation of IBI to gallstone prevalence. Furthermore, BRI mediates the effect of IBI on gallstone risk. These findings provide a more precise inflammatory marker for gallstone prevention and treatment. TRIAL REGISTRATION: Not applicable.