Boron- and nitrogen-containing porous carbon nanofibers (BN-CNFs) were prepared through one-step electrospinning using boric acid (H3BO3) and urea as boron and nitrogen precursors and a subsequent thermal treatment. The BN-CNFs showed higher capacitance and energy/power density values than the control sample of CNFs in aqueous electrolyte; the large surface area of 559 m2 g−1 and the NH, COOH, and [O]BN functional groups facilitated these improvements. The specific capacitance of the supercapacitor was 180 F g−1 at 1 mA cm−2, and the energy density was 17.2–23.5 W h kg−1 in the power density range of 400–10,000 W kg−1 in an aqueous electrolyte.