Heteroatom-doped carbon nanomaterials with well-defined porous are used as anode materials for SIBs due to their exceptional structural characteristics. In this work, porous N-doped carbon networks composed with ultrathin carbon nanosheets were synthesized via the direct pyrolysis of Vitamin B5. The content of nitrogen, specific surface area, porous structure of the N-doped carbon nanosheet networks were adjusted by changing reaction temperatures. The formation mechasim of the ultrathin N-doped carbon nanosheet networks was also proposed. The generation of calcium carbonate/calcium oxide used as a self-template renders the formation of the porous structure via thermal treatment. The optimized samples possess a superior lithium and sodium storage: 1534mAhg−1 at 100mAg−1 vs. Li/Li+ and 335mAhg−1 at 100mAg−1 vs. Na/Na+, with nearly 100% cycling Coulombic efficiency, remarkable cycling retention and high rate capacity. Additionally, good electrocatalytic activity for ORR via a 4e−1 pathway determines that the resulting primary Zn-air battery showed high discharge power energy density (80mWcm−2), high reversibility and stability over continuous cycles.