Pyrolysis is a necessary procedure for synthesizing carbon‐based nonprecious metal electrocatalysts via stimulating interaction and carbonization of precursors. In this work, ramping rates that correlated with thermal gradient has been investigated to reveal the configuration evolution of the precursors. Spectra characterizations demonstrated that ramping rates affected decomposition and aromatization of precursors. Increasing ramping rates improved the percentage of doped nitrogen and defects, promoting dispersion of Co atoms in the carbonaceous matrix and increasing density of active sties. In addition, the size variation of NaCl template under different ramping rates modifies the porous structure of Co/N−C electrocatalysts, greatly increasing the percentage of macropores and micropores at rapid ramping rates. As a result, electrocatalysts obtained at 5 °C min−1 exhibit comparable catalytic activity to that of Pt/C due to highly dispersed active sites and rational percentage of porosity, facilitating the sufficient reaction of oxygen along the catalysts. These results shed lights on regulating physical properties of carbonaceous electrocatalysts.