5-aminotetrazoles has been developed by employing simple ketones as substrates. This methodology involved the N2-extrusion/aryl migration of azido complexes as the key step for the in situ generation of carbodiimidium ion, which could further react with hydrazoic acid and cyclize intramolecularly to provide 5-aminotetrazoles in good to excellent yields. In addition, the regioselectivity of the reaction was studied