Thermolysis of 5-azido-4-formyl-3-methyl-1-phenylpyrazole 4 produces the (4-cyanopyrazol-3-ylmethyl)pyrazoles 3 and 6. 2-Cyano-3-phenylazo-2-butenal 2 was detected by H-1 NMR spectroscopy during the reaction. The products 3 and 6 and other rearrangement products obtained when 5-chloro-4-formylpyrazoles are reacted with azide ion all seem to be formed by a common mechanism, via substituted 2-cyano-3-azo propenals or a zwitterionic intermediate. The nature of the products is determined by the position of nucleophilic attack at the intermediate. Structural characterization of the products has been obtained by NMR spectroscopy and single-crystal X-ray crystallography.