The formation of C–S bonds with high activity in a carbon skeleton is considered to be one of the most effective strategies to facilitate highly reversible alkali storage reactions. In this work, by the combination of heteroatomic control and structural design, N, P and S ternary–doped hierarchical porous soft carbon (NPSC) is obtained with a high concentration of C–S bonds, large specific surface area and large graphitic interlayer spacing. As anode materials for lithium–ion batteries (LIBs), NPSC exhibits a reversible capacity of 500 mA h g−1 and 90% capacity retention can be realized at 500 mA g−1 after 500 cycles, showing its high–rate capability and long–term cyclability. In addition, a full cell based on a LiVPO4F cathode and an NPSC anode delivers high discharge capacity and superior cycling stability. This high performance is attributed to the introduction of P, which promotes the utilization of S through the formation of C–S bonds. In addition, the synergistic doping effect increases the interlayer spacing, facilitating rapid interfacial Li+ adsorption and diffusion reactions. This strategy provides an efficient route toward excellent heteroatom–doped carbon for energy storage and conversion applications.