Chemical hair dye components can have allergenic, reproductive, and carcinogenic risks. Detecting restricted and prohibited ingredients in these products is challenging due to product diversity, isomer separation, instability, and wide polarity range. A method was developed using HPLC-high-resolution mass spectrometry for the qualitative and quantitative analysis of 54 hair dye components in various products. Samples were extracted with a 70% methanol solution, ultrasonicated in an ice bath, centrifuged, filtered, diluted with 25% methanol solution and 25% methanol solution containing 0.05% D-isoascorbic acid. Separation was achieved using an ACE Excel 3 C18 column (2.1 mm × 150 mm, 3 μm) with analysis conducted via quadrupole Orbitrap mass spectrometry. It showed good linear correlations, with detection limits of 0.1-23.5 ng mL-1, and quantitation limits of 0.2-78.1 ng mL-1. Average recovery ranged from 60.0% to 118.4%, with repeatability from 4.0% to 14.9%. Stability was confirmed within 48 hours. When applied to 20 batches of commercially available hair dyes, 24 hair dye components were found within permissible levels. The method is crucial for quality control of hair dyes, covering 10 common prohibited and 44 permissible hair dye components outlined in the Safety and Technical Standards for Cosmetics (2015 Edition). Compared to the standard methods, it can separate isomers in a single mobile phase system within 15 minutes in positive ion mode while maintaining sensitivity for phenol, hydroquinone, and other components in negative ion mode. Moreover, the pre-treatment strategy significantly improved stability and accuracy, enabling precise analysis of the 54 hair dye components.