Berberine is a widely used plant extract for gastrointestinal infections, and is reported to have potential benefits in treatment for diabetes and hypercholesterolemia. It has been suggested that interactions between berberine-containing products and cytochromes P450 (CYPs) exist, but little is known about which CYPs mediate the metabolism of berberine in vivo. In this study, berberine metabolites in urine and feces of mice were analyzed, and the role that CYPs play in producing these metabolites were characterized in liver microsomes from mice (MLM) and humans (HLM), as well as recombinant human CYPs. Eleven berberine metabolites were identified in mice, including 5 unconjugated metabolites, mainly in feces, and 6 glucuronide and sulfate conjugates, predominantly in urine. Three novel berberine metabolites were observed. Three unconjugated metabolites of berberine were produced by MLM, HLM, and recombinant human CYPs. CYP2D6 was the primary recombinant human CYP producing these metabolites, followed by CYP1A2, 3A4, 2E1 and CYP2C19. The metabolism of berberine in MLM and HLM was decreased the most by a CYP2D inhibitor, and moderately by inhibitors of CYP1A and 3A. CYP2D plays a major role in berberine biotransformation, therefore, CYP2D6 pharmacogenetics and potential drug-drug interactions should be considered when berberine is used.