Intestinal bacteria play an important role in bile acid metabolism and in the regulation of multiple host metabolic pathways (e.g., lipid and glucose homeostasis) through modulation of intestinal farnesoid X receptor (FXR) activity. Here, we examined the effect of berberine (BBR), a natural plant alkaloid, on intestinal bacteria using in vitro and in vivo models. In vivo, the metabolomic response and changes in mouse intestinal bacterial communities treated with BBR (100 mg/kg) for 5 days were assessed using NMR- and mass spectrometry–based metabolomics coupled with multivariate data analysis. Short-term BBR exposure altered intestinal bacteria by reducing Clostridium cluster XIVa and IV and their bile salt hydrolase (BSH) activity, which resulted in the accumulation of taurocholic acid (TCA). The accumulation of TCA was associated with activation of intestinal FXR, which can mediate bile acid, lipid, and glucose metabolism. In vitro, isolated mouse cecal bacteria were incubated with three doses of BBR (0.1, 1, and 10 mg/ml) for 4 hours in an anaerobic chamber. NMR-based metabolomics combined with flow cytometry was used to evaluate the direct physiologic and metabolic effect of BBR on the bacteria. In vitro, BBR exposure not only altered bacterial physiology but also changed bacterial community composition and function, especially reducing BSH-expressing bacteria like Clostridium spp. These data suggest that BBR directly affects bacteria to alter bile acid metabolism and activate FXR signaling. These data provide new insights into the link between intestinal bacteria, nuclear receptor signaling, and xenobiotics.