A new approach for fast and sensitive electrochemiluminescence (ECL) detection of narcotic drugs on a microchip after separation by micellar electrokinetic chromatography (MEKC) is presented, taking the cocaine and its hydrolysate ecgonine as the test analytes. The mixture of hydrophilic BMIMBF 4 ionic liquid (IL) and sodium dodecyl sulfate (SDS) was used directly as the buffer of MEKC with less noisy baselines, lower electrophoretic current and satisfactory separation performance. This developed microchip MEKC -ECL system was successfully applied to the determination of two very similar narcotics, heroin and codeine, within 100s in urine sample and was demonstrated as a promising method in clinical and forensic analysis.