BackgroundNonalcoholic fatty liver disease (NAFLD) and gallstones are generally seen together, and many of the risk factors for fatty liver and gallstones are common and similar. Therefore, this study aims to investigate the relationship between NAFLD and gallstones.MethodsThis case‐control study was conducted in patients referred to Imam Khomeini and Golestan hospitals of Ahvaz University of Medical Sciences in 2023, whose ultrasound showed fatty liver. Patients who were diagnosed with NAFLD by ultrasound were considered as the case group, and patients who did not have diagnostic findings of fatty liver in ultrasound were considered as the control group. Finally, the information recorded in the checklists was statistically analyzed using SPSS version 26 (SPSS Inc.).ResultsThree hundred patients were included in our study, 150 as cases and 150 as controls. There was no significant difference between the groups in terms of gender and age (gender P‐value: 0.817/age P‐value: 0.102). A statistically significant relationship was found between obesity, diabetes mellitus (DM), the presence of gallstones, and NAFLD (weight p‐value < 0.001/DM p‐value < 0.001/gallstones P‐value: 0.03). In addition, based on binary logistic regression analysis, the presence of gallstones increases the odds of NAFLD by 2.33 times (P‐value: 0.035). Furthermore, having DM and increasing each BMI unit increases the odds of NAFLD by 16 times and 30%, respectively (BMI p‐value < 0.001/DM p‐value < 0.001).ConclusionBased on the results of our study, gallstones are an important risk factor for NAFLD. The possible mechanisms are the existence of common risk factors between gallstones and NAFLD and the reduction of motility and flow of bile in the bile ducts with the presence of gallstones.