We describe a new electrochemical method of N-alkylation of heterocycl
ic nitrogen compounds. The reaction was applied to carbazole, phenothi
azine, and 2-chlorophenothiazine with alkyl halides and alpha-halogeno
esters. The synthesis involves a ''one-pot'' two-step procedure. The e
lectrolysis, in an undivided cell fitted with a sacrificial magnesium
anode, first generates the amide anion of the heterocyclic molecule. A
ddition of the alkylating reagent then yields the substituted product.