The development of highly active metal-free electrocatalysts with durability in both alkaline and acidic media as alternatives for platinum-based catalysts is critical for fuel cells and metal-air batteries. Herein, N-doped carbon nanofibers aerogels derived from commercial aramid are prepared using a facile and cost-effective process based on solvent-exchange followed by freeze-drying and pyrolysis under N2 atmosphere. The as-prepared catalyst exhibits high electrocatalytic activity towards the oxygen reduction reaction with a half-wave potential estimated to 0.91 V (vs. reversible hydrogen electrode) in 0.1 M KOH. This value is more positive than that of Pt/C. The N-doped carbon nanofibers aerogels also display excellent activity in 0.1 M HClO4, with only 83 mV difference in half-wave potential from that of Pt/C. In addition, the catalyst shows higher long-term durability and methanol-resistance than commercial Pt/C catalyst in both alkaline and acidic media. The efficient properties of N-doped carbon nanofibers aerogels are attributed to the synergistic effect of the hierarchical porous structure, defects and homogeneous distribution of abundant N species as electrocatalytic active sites in the carbon matrix. Overall, the good electrocatalytic performance combining with the simple cost-effective strategy make it a promising potential electrocatalyst for future use in fuel cells and metal-air batteries.