Hydroxysafflor yellow A (HSYA) is the main bioactive ingredient of XBJ injection. At first, the stability of HSYA in solution and in a Xuebijing injection was investigated, then the mechanisms of the increased stability of HSYA in the XBJ injection were investigated to provide useful information on clinical safety. HSYA stability was investigated as a function of pH and temperature in aqueous solution and an XBJ injection, following the guidelines from the International Conference on Harmonisation of Technical Requirements for Registration of Pharmaceuticals for Human Use. Products were identified by UPLC-MS/MS. HSYA reaction followed first-order kinetics under all conditions. The half-life of HSYA in XBJ was almost 40 times longer than in aqueous solution. The activation energies of HSYA reaction in aqueous solution and XBJ were calculated to be 78.53 and 92.90 kJ∙mol−1 by using Arrhenius equation. The results indicated that HSYA was more stable in XBJ than in aqueous solution. Two products were identified and the mechanism was intra-molecular nucleophilic substitution. The excellent stability of HSYA in XBJ injection partly due to the micelles formed in the injection. The study may provide clues for compatibility in TCM prescription and also provide useful information for further preparation technology research of HSYA and assessment of clinical safety of XBJ.