Morphine, codeine and O6-acetylmorphine are reacted with heptafluorobutyric anhydride, rendering them suitable for electron capture detection and quantitation. The fluorinated derivatives are extracted from an acetonitrile-sodium bicarbonate solution into light petroleum in a rapid one-step extraction procedure. The derivatives are chromatographed on a stationary phase of 3% OV-17 on Gas-Chrom Q. Morphine, codeine and O6-acetylmorphine can be readily quantitated in heroin at levels as low as 0.001%, 0.01% and 0.01% respectively. Reproducibility, linearity and recovery studies are described.