The current use and misuse of synthetic and prescription opioids in the USA has reached epidemic status. According to the US Department of Health and Human Services, every day more than 130 people in the USA die after overdosing on opioids, and 2.1 million had an opioid use disorder in 2018. Hair is becoming an alternative matrix of increasing interest in forensic toxicology to investigate drug use and abuse patterns due to its long window of detection. The focus of this project was to develop and validate a method that simultaneously detects and quantifies 27 classic, prescription and synthetic opioids in hair by liquid chromatography–tandem mass spectrometry (LC–MS-MS). Hair samples were decontaminated and pulverized in a bead mill. Twenty-five milligrams of hair powder were incubated in a buffer overnight. Mixed mode cation exchange solid phase extraction was carried out before undergoing reversed-phase chromatographic separation, successfully resolving isobaric opioids. We used two multiple reaction monitoring transitions in positive mode to identify each analyte. The linearity range was 1–500 pg/mg for fentanyl and synthetic opioids and 10–500 pg/mg for prescription and classic opioids. Imprecision was &lt;17.5% and bias ranged from −13.6 to 12.0%. Majority of compounds showed extraction efficiency &gt;50%, and ion suppression from −89.2 to −26.6% (CV &lt; 19%, n = 10). This method was applied to 64 authentic cases, identifying 13 compounds from our panel. A sensitive and specific method was developed for the identification and quantification of 27 classic, prescription and synthetic opioids in hair by LC–MS-MS.