Flash vacuum pyrolysis (FVP) of pyrazoles and indazoles constitutes a valuable route to carbenes and nitrenes. In this study, we employed M062X and CCSD(T) calculations to provide a mechanistic rationale for the formation of fulvenallene and fluorenes from indazoles and the corresponding formation of azafulvenallene 15, cyanocyclopentadiene 19, and azafluorenes, e.g. 45, from azaindazoles, e.g. 12, and from homoquinolinic anhydride. The results reveal the importance of initial tautomerization in the pyrazole moiety of 7-azaindazole 12, which drives the mechanism toward 2-diazo-3-methylene-2,3-dihydropyridine 29 and hence 3-methylene-2,3-dihydropyridin-2-ylidene 26, followed by Wolfftype ring contraction to 1-azafulvenallene 15. This path has a calculated activation energy ∼10 kcal/mol lower than that for an alternate route involving ring opening to 3-diazomethylpyridine, dediazotization, and rearrangement of 3-pyridylcarbene to azacycloheptatetraene and phenylnitrene 24. FVP of 2,5-diphenyltetrazoles and phenyl(pyridyl)tetrazoles leads to nitrile imines, which cyclize to 3-phenylindazoles and -azaindazoles. Nitrogen elimination from these (aza) indazoles results in the formation of (aza) fluorenes, for which two alternate mechanisms are described: route A by rearrangement of (aza) indazoles to diazo(aza)cyclohexadienes and (aza)cyclohexadienylidenes and route B by rearrangement to diaryldiazomethanes and diarylcarbenes. Both paths are energetically feasible, but path A is preferred and corresponds to the azafluorenes obtained experimentally.