An ultra-high-performance liquid chromatography mass spectrometry method was established to detect and identify the chemical constituents of Zi Shen Formula (ZSF) and its metabolites in serum, urine and feces, after oral administration to rats. A total of 68 compounds were characterized in ZSF extracts. In vivo, 38 prototype components and 32 metabolites of ZSF were tentatively identified in rat serum, urine and feces. Seven metabolic pathways including demethylation, hydroxylation, oxidation, sulfation, glucuronidation, methylation and de-caffeoyl were proposed to be involved in the generation of these metabolites. It was found that glucuronidation, methylation and demethylation were the major metabolic processes of alkaloids, while demethylation, methylation, sulfation and de-caffeoyl were the major metabolic pathways of phenylethanoid glycosides. The main metabolic pathways of steroidal saponins were oxidation and isotype reactions. These findings are significant for our understanding of the metabolism of ZSF. The proposed metabolic pathways of bioactive components might be crucial for further studies of the mechanisms of action and pharmacokinetic evaluations of ZSF.