An efficient and direct method is described for the synthesis of 5-arylamino-1 H-tetrazoles (Isomer A) or 1-aryl-5-amino-1 H-tetrazoles (Isomer B) and 5-aryloxytetrazoles from arylcyanamides or cynates with nano CoFe2O4 as a reusable and efficient heterogeneous catalyst. Isomer A was obtained from arylcyanamides carrying electron-withdrawing substituents on the aryl ring, while isomer B was produced with electron-releasing groups. The significant advantages of this methodology are high yields, elimination of dangerous and harmful hydrazoic acid, simple work-up procedure and the recovery and reusability of the catalyst.