In researching energetic materials with high energy density, it is an effective method to introduce explosophoric groups. In this study, four series of energetic compounds were designed by functionalizing with C- or N-, introducing energetic groups -CH(NO2)2, -CF(NO2)2, -C(NO2)2(NF2), -C(NO2)3, and-CH(NF2)2 into imidazole and pyrazole structures. Density functional theory was employed to optimize the structure of the target compound and subsequently to predict and evaluate its performance based on this. Meanwhile, the sensitivity of the compounds was predicted based on their electrostatic potential analysis. Following analysis of the geometric structure, detonation performance, and sensitivity of the compounds, three factors were discussed: energetic groups, functionalization methods, and skeleton structure differences. The results indicate that C-functionalization has advantages only in density, but N-functionalization is better in thermal stability, heat of formation, and sensitivity. Meanwhile, the data shows that imidazole-based compounds exhibited greater density and detonation performance in the target compounds designed within this study, while pyrazoles have a higher heat of formation and chemical stability. By analyzing the design strategy of C- or N-functionalization of novel high-energy groups on energetic imidazole or pyrazole rings and selecting a more suitable molecular construction strategy, this study provides a theoretical approach for the development of new energetic materials with excellent performance. Gaussian 09 and Multiwfn 3.8 packages are the software used for calculation, and the electrostatic potentials were depicted using the VMD program. In this study, the imidazole and pyrazole derivatives were optimized at the B3PW91/6-311G (d, p) level to acquire the relevant data for the compounds.