In this study, process for the formation of activated and mesoporous carbon nanofibers (CNF) and their electrochemical activities were investigated. The fibers were obtained using lignin/poly (vinyl alcohol) polymer blends as carbon precursor. Potassium hydroxide was used as pore-formation and activation agent and was applied in-situ before fiber production and after carbonization. The morphology and structure of fibrous mats were characterized by SEM, FTIR and Raman spectroscopy, while the effect of the activation methods on the surface area and porosity was investigated using BET analysis. All types of carbon nanofibers were further used as free-standing anodes in half cell lithium and sodium ion batteries and their charge/discharge behavior was tested at different current densities. The results showed that high cycling stability can be achieved when CNFs with mesoporous structures are used as anodes for both lithium and sodium ion cells.