Abstract Heterocyclic compounds bearing an acidic hydrogen atom attached to nitrogen such as carbazole, indole, and phenothiazine can be efficiently alkylated in DMSO or N, N- DMF under ultrasonic irradiation in the presence of potassium hydroxide as a base. In almost all cases, a dramatic reduction of the reaction time results and a clear yield increase accompanied by an improved quality of the products occurs.