A systematic study is made of the effect of the nitrogen species on the performance of Li-ion storage and the capacities of carbon-based anodes in Li-ion batteries (LIBs). Electrospun carbon nanofiber (CNF) films are fabricated for use as binder-free electrodes using a polyacrylonitrile precursor. When the CNF films are subjected to carbonization, transformation occurs from an amorphous to a graphitic structure with associated reduction of nitrogen-containing functional groups. The structural change strongly affects where the Li ions are stored in the CNF electrodes. It is revealed that Li ions can be stored not only between the graphene layers, but also at the defect sites created by nitrogen functionalization. The latter is mainly responsible for the widely reported improved electrochemical performance of LIBs due to N-doping of carbon materials. An optimized carbonization temperature of 550 °C is identified, which gives rise to a sufficiently high nitrogen content and thus a high capacity of the electrode.