Background: The study objectives were to reveal the anthocyanin biosynthesis metabolic pathway in white and purple flowers of Salvia miltiorrhiza using metabolomics and transcriptomics, to identify different anthocyanin metabolites, and to analyze the differentially expressed genes involved in anthocyanin biosynthesis . Results: We analyzed the metabolomics and transcriptomics data of Salvia miltiorrhiza flowers. A total of 1994 differentially expressed genes and 84 flavonoid metabolites were identified between the white and purple flowers of Salvia miltiorrhiza . Integrated analysis of transcriptomic and metabolomics showed that cyanidin 3,5-O-diglucoside, malvidin 3,5-diglucoside, and cyanidin 3-O-galactoside were mainly responsible for the purple flower color of Salvia miltiorrhiza. A total of 100 unigenes encoding 10 enzymes were identified as candidate genes involved in anthocyanin biosynthesis in Salvia miltiorrhiza flowers. The low expression of the ANS gene decreased the anthocyanin content but enhanced the accumulation of flavonoids in Salvia miltiorrhiza flowers. Conclusions: Our results provide valuable information on the anthocyanin metabolites and the candidate genes involved in the anthocyanin biosynthesis pathways in Salvia miltiorrhiza .