Khat is a common plant that grows primarily in Eastern Africa and the Arabian Peninsula. Cathinone, norpseudoephedrine, and norephedrine are the main psychoactive components of khat. Experimental studies have shown that red and green khat have similar cathinone contents, but green khat contains more norpseudoephedrine and norephedrine than red khat. Research indicates that Ethiopians believe that red khat has stronger psychoactive effects than green khat. Therefore, we speculated that other substances in red khat may enhance its psychoactive effects. Using the sampling method, we identified two other psychoactive components in khat: methcathinone and ethcathinone. At present, only a few studies on the extraction and detection of alkaloids from khat have been published in China, and no reports on the extraction and detection of methcathinone and ethcathinone from khat are available. In this study, we established an extraction and detection method for five alkaloids in dried khat using high performance liquid chromatography-quadrupole time-of-flight mass spectrometry (HPLC-Q-TOF MS). To establish the extraction method, we optimized the extraction solvent and process. The amounts of dichloromethane and sodium hydroxide added during the purification step were also optimized. To establish the detection method, we optimized the chromatographic and MS conditions. The final extraction and detection method was as follows: Dried khat powder (0.1 g) was loaded into a polypropylene centrifuge tube, added with 1 mL of 0.05 mol/L hydrochloride aqueous solution, and vortex-oscillated for 3 min for extraction. The sample was centrifuged at 10000 r/min for 3 min. Next, 600 μL of the supernatant was placed in a centrifuge tube, added with 1 mL of dichloromethane, shaken for 1 min, and centrifuged at 10000 r/min for 3 min. Subsequently, 300 μL of the supernatant was placed in a centrifuge tube, added with 80 μL of 1 mol/L sodium hydroxide aqueous solution, shaken for 1 min, and added with 1 mL of acetonitrile. Vortex oscillation was performed for 2 min to extract the sample, after which solid sodium chloride (0.4 g) was added to the mixture, followed by shaking for 1 min to separate the acetonitrile and aqueous phases. The mixture was then centrifuged at 10000 r/min for 3 min. Finally, the supernatant was collected and diluted for further testing. The five target analytes were separated on a ZORBAX Eclipse Plus Phenyl-Hexyl column (100 mm×3.0 mm, 1.8 μm) via gradient elution using 0.1% acetic acid aqueous solution and acetonitrile as mobile phases with a flow rate of 0.3 mL/min and column temperature of 30 ℃. The analytes were identified using the targeted MS/MS method under positive electrospray ionization mode and quantified using the external standard method. The five alkaloids showed good correlations (all correlation coefficients (r2)≥0.9976) with their respective linear ranges. The limits of detection were between 0.08 and 0.75 μg/L, and the limits of quantification were between 0.25 and 2.50 μg/L. The average recoveries of the five alkaloids from two plants with different alkaloid contents were between 90.7% and 105.2%. The intra-sample precision ranged from 0.5% to 2.3%, the intra-day precision was between 1.0% and 2.5%, and the inter-day precision was between 1.3% and 3.3%. Using the developed method, we extracted and analyzed 15 khat samples, and detected five alkaloids. This method enables rapid sample pretreatment and has high sensitivity, good stability, and suitable accuracy. Based on the above results, we conclude that the proposed method meets the inspection and identification requirements for khat. Thus, it can provide a valuable reference for the physical and chemical identification of khat and support for further studies on its psychoactive components.