A variety of alcohols and phenols are converted into their corresponding im
idazoles and triazoles in high yields by a facile reaction with N,N-1-carbo
nyldiimidazole (CDI) or N,N-1-carbonylditriazole (CDT) in acetonitrile. The
reactions of allylic alcohols, enols and phenols with CDI or CDT are unpre
cedented. Evidence is provided which suggests that the reaction with alcoho
ls proceeds via the corresponding carbamates by an S(N)i mechanism.