• For the first time, the structure-activity relationship between flavonoids and β-glucuronidase was investigated. • The core structure and the isopentenyl group were crucial in influencing the inhibitory activities against β-glucuronidase. • The amount of hydroxyl groups played a vital part in influencing the inhibitory activities towards β-glucuronidase. • The type and number of glycosyls played crucial roles in influencing the inhibitory activities against β-glucuronidase. • Delphinidin and baohuoside I are highly efficient. inhibitors of intestinal bacteria β-glucosidase. Dietary flavonoids are regarded as potent inhibitors of gut bacterial β-glucuronidase (β-GUS), although the precise structure-activity relationship between dietary flavonoids and β-GUS remains elusive. In this study, 24 dietary flavonoids of 6 common different structural types were selected as model molecules to investigate this relationship through enzymatic inhibition kinetics and molecular docking simulations. The findings revealed that delphinidin (1) and baohuoside I (16) exhibited robust inhibitory activities, while the formation of ionic bond and hydrogen bonds was found to play crucial roles in these interactions. Moreover, the core structure, position, and quantity of hydroxyl groups; type and number of glycosyls, and the presence of isopentenyl group all played pivotal roles in influencing inhibitory activities against β-GUS derived from Escherichia coli . These results offer valuable insights into the relationship between flavonoid structure and enzyme inhibition, which could prove invaluable for the development of novel drugs and flavonoid dietary supplements.