This study aimed to identify the related substances of midazolam hydrochloride by liquid chromatography-mass spectrometry (LC-MS). To separate the related substances of midazolam hydrochloride, gradient elution was performed using acetonitrile and 25 mmol/L of ammonium acetate (pH was adjusted to 5.5 with acetic acid) as mobile phase on Thermo BDS Hypersil C18 column (100 mm × 4.6 mm, 2.4 μm). The accurate mass and elemental composition of the parent ions and their product ions of related substances were determined by electrospray-ionization quadrupole time-of-flight mass spectrometry (ESI-Q-TOF/MS). The structures of the related substances were identified by spectral analysis and process synthesis, and some of them were further confirmed by reference substances. Under the established HPLC condition, midazolam hydrochloride and its related substances were adequately separated, and 22 major related substances were detected and identified by hyphenated techniques in midazolam hydrochloride and its stressed samples, of which 8 were recorded as impurities in the United States Pharmacopeia. The LC-MS techniques can effectively separate and identify the related substances of midazolam hydrochloride and provide reference for the establishment of storage condition, optimization of synthetic processes and quality control.