Nanostructured pyropolymers contain significant amounts of redox-active heteroatoms, have high specific surface areas, and a defective carbon microstructure, indicating good potential for pseudocapacitive charge storage. In this study, nitrogen-enriched pyropolymer nanoparticles (N-PNs-50) are fabricated from polyaniline nanotubes through rapid pyrolysis at 50 °C min−1. N-PNs-50 exhibit a nitrogen content of 9.8 wt%, a high specific surface area of 875.8 m2 g−1, and an amorphous carbon structure with an I D /I G intensity ratio of 0.95. These unique characteristics lead to good electrochemical performances, in which reversible capacities of 660 and 255 mAh g−1 are achieved for Li-ion and Na-ion storage, respectively, with favorable voltage characteristics (<1.5 V for Li-ions and <1.2 V for Na-ions). This study provides a more feasible production method for nitrogen-doped pyropolymers and their practicable electrochemical performances for use as an anode in energy storage devices.