Carbon materials are considered to be one of the most promising anode materials for sodium-ion batteries (SIBs), but the well-ordered graphitic structure limits the intercalation of sodium ions. Besides, the sluggish intercalation kinetics of sodium ions impedes the rate performance. Thus, the precise structure control of carbon materials is important to improve the battery performance. Herein, a 3D porous hard-soft composite carbon (3DHSC) was prepared using the NaCl as the template and phenolic resin and pitch as carbon precursors. The NaCl template restrains the growth of the graphite crystallite during the carbonization process, resulting in small graphitic domains with expanded interlayer spacing which is favorable for the sodium storage. Moreover, the NaCl templates help to create abundant mesopores and macropores for fast sodium ion diffusion. The porous structure and the graphite crystalline structure can be precisely controlled by simply adjusting the mass ratio of NaCl, and thus, the suitable structure can be prepared to reach high capacity and rate performance while keeping a relatively high Coulombic efficiency. Typically, a high reversible capacity (215 mA h g−1 at 0.05 A g−1), an excellent rate capability (97 mA h g−1 at 5 A g−1), and a high initial Coulombic efficiency (60%) are achieved.