A method based on liquid chromatography coupled with high-resolution quadrupole time-of-flight mass spectrometry (LC-QTOF-MS) was developed for the simultaneous screening and determination of fentanyl and its 26 analogs in liquid and solid powder drugs. The established method involves successive extraction by 5 mL 75% (v/v) acetonitrile aqueous solution and 5 mL acetonitrile, followed by clean-up using the hydrophilic lipophilic balance (HLB) solid-phase extraction method. Detection was achieved by electrospray ionization (ESI) in the positive mode, TOF-MS, and information-dependent acquisition (IDA)-MS/MS acquisition; the external standard method was adopted for quantification. Two databases of accurate mass and fragment ions were created. The standard matrix-matched calibration curves of the 27 target compounds were linear in the range of 5.00-100 μg/L, with the correlation coefficients ()>0. 99. The limits of quantification for the 27 target compounds were 10.0 μg/kg. The recoveries for all the target compounds in vitamin C tablet, headache powder, cough syrup, and transdermal patch samples were in the ranges of 82.9%-106%, 84.8%-106%, 86.9%-109%, and 83.1%-106%, respectively, with relative standard deviations ranging from 0.38% to 8.71% (=6). The results demonstrated that the developed method is rapid and sensitive for the simultaneous monitoring and determination of fentanyl and 26 its analogs in liquid and solid powder drugs.