A theoretical study of the monosubstitution effects of all the atoms of the second and third row of the periodic table on the pyrazole and imidazole rings has been carried out by means of B3LYP/6-31+G(d,p) DFT calculations. The geometric and electronic properties, calculated using the atoms in molecules methodology, electrostatic potential, and frontier orbitals have been analyzed. Some of the results have been rationalized based on the electronegativity of the substituents. In addition, the different parameters obtained have been compared with aromaticity indexes (HOMA and NICS). A comparison with the results obtained for the corresponding N-pyrrole derivatives has been carried out.