Methods for regioselective N-trideuteromethylation of tautomeric polyaza heterocycles are highly sought-after. Disclosed herein is an N-trideuterated methylation reaction of imidazoles and pyrazoles with high regioselectivity and deuterium purity using easily available CF3SO3CD3 as the -CD3 source. This method enables the easy synthesis of important deuterium-labeled azoles, including dimetridazole-d3, ipronidazole-d3, hydroxy dimetridazole-d3, and ronidazole-d3.