Synthesis and mass spectrometric characterization of drugs or metabolites labeled by stable isotopes has been of great interest in fields of clinical, forensic and doping control analysis. Deuterated ephedrine and p-hydroxypseudoephedrine were prepared from corresponding amines by a novel procedure utilizing N- methyl-N-trimethylsilyltrifluoroacetamide and deuterated iodomethane. The mechanism of methylation was studied by mass spectrometry using phenylethylamine as a model compound, and a rearrangement based on an intermediate six-membered ring structure with a trimethylsilyl-enol-ether is proposed giving rise to a leaving group of trimethyliodosilane and the desired monomethylated product. Deuterated analogues to frequently quantitated ephedrines were readily synthesized with purities >90%, and mass spectra recorded under different ionization and dissociation conditions presented distinct fragmentation processes including eliminations of water and methylamine as well as the generation of a benzyl cation.