Background: Hair samples are recognized as alternative biological specimens in forensic and clinical toxicology for detecting drug abuse and poisoning. Forensic testing for opioids in hair has become a useful diagnostic measure for assessing chronic drug usage through segmental analysis. However, accurate, sensitive and specific analytical methods are needed. The aim of this study was to introduce a simple, sensitive and specific GC-MS method for the identification and quantitation of selected and commonly abused opioids (tramadol, methadone, morphine, and codeine) in hair samples. Methods: After external decontamination, a 50 mg portion of powdered hair sample was combined with hydrochloric acid (0.1 M) and incubated on a magnetic stirrer at 56°C for 16 hours. Then, 1 mL of sodium hydroxide (0.1 M) and 2 mL of phosphate buffer (1 M, pH=8.4) were added. Chloroform-isopropanol (ratio: 80:20 V/V) was utilized as the extracting solvent and the sample was homogenized and centrifuged for 5 minutes (at 3500 rpm). After centrifugation, the organic phase was dried using dry nitrogen gas. The sample was derivatized with N-methyl-N-(trimethylsilyl) trifluoroacetamide (MSTFA). The blank, standards, and real samples were subsequently analyzed by GC-MS.Results: The limits of detection in the linearity experiments ranged from 0.12 to 0.21 ng/mg. According to the validation results, the method exhibited linearity in the concentration range of 0.1-2.5 ng/mg for all analytes, with calibration curve slopes ranging from R2=0.98 to 0.99. Good inter and intra-day precision relative standard deviations (RSDs) were observed to be <3.5% for all compounds. Extraction efficiency varied from 91.8 to 102.4%. Conclusion: The validation and analysis of actual samples indicate that this method is straightforward, sensitive, and specific for the analysis of opioids in routine hair analysis.