The distinctive features of one-dimensional porous heteroatom doped carbon nanofibers, such as their high surface area, fibrous morphology, numerous active sites (heteroatom centers) facilitating surface redox reactions, and impressive mechanical strength, render them appealing candidates for capacitive energy storage. This study presents an electrospinning mediated two-step synthesis approach for highly porous carbon nanofibers. In the first step, electrospinning of polyacrylonitrile (PAN), polyvinylpyrrolidone (PVP), and carbon nitride (CNx) followed by carbonization was employed to prepare CNx‑carbon nanofibers (CN-CNF-x_c, where x = amount of CNx). The second step, involving high-temperature KOH activation, leads to the formation of highly porous carbon nanofibers (CN-CNF-x) with an exceptionally high specific surface area (SSA) of 2000.8 m2 g−1 coupled with a micropore volume of 0.67 cc g−1. The as-synthesized porous carbon fibers were then utilized in energy storage applications. The CN-CNF-x demonstrated a maximum specific capacitance (Cs) of 483 F g−1 and 456 F g−1 at 1 A g−1 in basic and acidic media, respectively. This capacitance performance was nearly three times higher than the non-activated carbon nanofibers without CNx i.e., CN-CNF-0_c (Cs = 178 F g−1 at 1 A g−1 in 6 M KOH) and other reported electrospun carbon nanofibers. The symmetric device fabricated using the CN-CNF-x exhibited an 85 % capacitance retention in an alkaline medium over 5000 cycles, along with a peak energy density (ED) of 12.22 W h kg−1 and a maximum power density (PD) of 2500 W kg−1. Therefore, incorporating CNx into the PAN/PVP nanofibers, combined with KOH activation, presents a promising avenue for enhancing their performance in energy storage applications. The collaborative effects of high SSA, an abundance of micropores, porous nanofiber morphology, and N, O doping work synergistically to improve electrochemical performance, ultimately leading to the fabrication of superior supercapacitor devices.