Intervertebral disc degeneration (IVDD) is the main cause of lower back pain. Oxidative stress injury and degradation of the extracellular matrix (ECM) are important factors causing IVDD, while hydroxysafflor yellow A (HSYA) has significant anti-oxidative stress and anti-apoptotic effects. The present study aimed to investigate the protective role of HSYA in IVDD using nucleus pulposus (NP) cells. A Cell Counting Kit-8 assay was used to detect cell viability following HSYA and tert-Butyl hydroperoxide (TBHP) treatment. Cellular reactive oxygen species levels and the level of apoptosis were measured using flow cytometry. The concentration of superoxide dismutase (SOD), malondialdehyde (MDA), catalase (CAT) and glutathione peroxidase GSH-Px were detected using ELISA. DAPI staining was performed for nuclear morphology analysis, while western blot analysis was used to detect apoptotic-and ECM-related protein expression levels. Bioinformatics analysis was used to predict the binding site between HSYA and carbonic anhydrase 12 (CA12; CA XII). NP cells were transfected withsmall interference RNA (siRNA) for CA XII downregulation. Following TBHP treatment, the level of ROS increased significantly, and the concentrations of SOD, CAT and GSH-Px were decreased. In addition, the apoptosis level of the NP cell line significantly increased following TBHP treatment. Furthermore, the expression levels of ECM-related proteins, collagen II and aggrecan were significantly decreased, and the protein expression level of MMP-13 was significantly increased. HSYA (10 µM) could effectively alleviate the effects of TBHP on NP cell apoptosis, oxidative stress damage and the expression level of ECM-related proteins. A binding site was found between HSYA and CA XII. In addition, CA XII-siRNA significantly reduced the increase in the expression level of collagen II and aggrecan proteins and decrease in the expression level of MMP-13 induced by HSYA in the NP cell line. In conclusion, HSYA could attenuate oxidative stress injury and apoptosis induced by TBHP in the NP cell line, and could improve the regulation of ECM balance.