Thermally sensitive tetramethylammonium oxalate (TMAO) is incorporated as an in situ porogen into freestanding nonwoven nanofibers of polyacrylonitrile (PAN) produced by electrospinning. Supercapacitor electrode materials are prepared by a series of thermal treatments on these fibers, including stabilization followed by a single step carbonization and CO2 activation. The specific surface areas of the resultant carbon nanofibers (CNFs) are controlled by varying the amounts of TMAO in the precursor fibers. The electrochemical properties of the carbon nanofibers are characterized by cyclic voltammetry and galvanostatic charge–discharge tests. The highest surface area (2663 m2 g−1) and best electrochemical performance are obtained from PAN containing 0.1 wt% of TMAO (T10), which gives a maximum specific capacitance of 140 F g−1 at a scan rate of 10 mV s−1 in comparison to CNFs from PAN alone, which yielded only 90 F g−1. At a discharge current density of 1 A g−1, the obtained energy and power densities are 68 Wh kg−1 and 1.7 W kg−1, respectively, with capacitance retention of 80% after 1000 cycles.