BackgroundCholesterol gallstone disease is a common disease. Reducing cholesterol burden is important to prevent/treat gallstone. In this study, we investigated the application of diosgenin (DG) to prevent the formation of gallstone in mice.MethodsAdult male C57BL/6J mice were fed with the lithogenic diet (LD) only or LD supplemented with DG or ezetimibe for 8 weeks. Incidences of gallstone formation were documented. Intestine and liver tissues were collected to measure the lipid contents and expression of genes in cholesterol metabolism. Caco2 cells were treated with DG to monitor the regulation on cholesterol absorption and the transcriptional regulation ofNpc1l1gene. Changes of gut microbiota by DG was analyzed. Intraperitoneal injection of LPS on mice was performed to verify its effects on STAT3 activation andNpc1l1expression in the small intestine.ResultsLD led to 100% formation of gallstones in mice. In comparison, dietary DG or ezetimibe supplementary completely prevents gallstones formation. DG inhibited intestinal cholesterol absorption in mice as well as in Caco2 cells by down-regulation ofNpc1l1expression. DG could directly inhibit phosphorylation of STAT3 and its transcriptional regulation ofNpc1l1expression. Furthermore, DG could modulate gut microbiota profiles and LPS mediated STAT3 activation andNpc1l1expression.ConclusionOur results demonstrated that dietary DG could inhibit intestinal cholesterol absorption through decreasing NPC1L1 expression to prevent cholesterol gallstone formation.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12929-023-00933-3.