Nitrogen-doped carbon nanotubes (NCNTs) have been successfully synthesized via the direct solid pyrolysis of Zn–Fe-ZIF and the N content, N doped state, diameter and formation temperature of the NCNTs can be finely tuned by mixing Zn–Fe-ZIF with proper amounts of dicyandiamide (DCDA). DCDA serves as the extra nitrogen supplier and favors the formation of NCNTs at relatively low temperature due to its inducing effect for graphitic structure. The synthesized NCNTs, with iron species and high amounts of graphitic N, exhibit higher catalytic activity than commercial Pt/C as oxygen reduction electrocatalysts in alkaline solution.