Streptococcus mutans (S. mutans), the prime pathogen of dental caries, can secrete glucosyltransferases (GTFs) to synthesize extracellular polysaccharides (EPSs), which are the virulence determinants of cariogenic biofilms. Ursolic acid, a type of pentacyclic triterpene natural compound, has shown potential antibiofilm effects on S. mutans. To investigate the mechanisms of ursolic acid-mediated inhibition of S. mutans biofilm formation, we first demonstrated that ursolic acid could decrease the viability and structural integrity of biofilms, as evidenced by XTT, crystal violet, and live/dead staining assays. Then, we further revealed that ursolic acid could compete with the inherent substrate to occupy the catalytic center of GTFs to inhibit EPS formation, and this was confirmed by GTF activity assays, computer simulations, site-directed mutagenesis, and capillary electrophoresis (CE). In conclusion, ursolic acid can decrease bacterial viability and prevent S. mutans biofilm formation by binding and inhibiting the activity of GTFs.