Nitrogen-doped porous carbon nanofiber webs-sulfur composites (N-CNFWs/S) were synthesized for the first time with sulfur (S) encapsulated into nitrogen-doped porous carbon nanofiber webs (N-CNFWs) via a modified oxidative template route, carbonization-activation and thermal treatment. The composites were characterized using scanning electron microscopy (SEM), transmission electron microscopy (TEM), Brunauer–Emmett–Teller (BET), X-ray powder diffraction (XRD), and thermogravimetry (TG) measurements. The results show that sulfur is well dispersed and immobilized homogeneously in the micropores of nitrogen-doped porous carbon nanofiber webs (N-CNFWs) with high electrical conductivity, surface area and large pore volume. The electrochemical tests show that the N-CNFWs/S composites with 60wt. % of S have a high initial discharge capacity of 1564mA h g−1, a good cycling stability at the current density of 175mAg−1, and excellent rate capability (reversible discharging capacity of above 400mA h g−1 at 1600mAg−1).