Nitrogen-doped hierarchically porous coralloid carbon/sulfur composites (N-HPCC/S) served as attractive cathode materials for lithium–sulfur (Li–S) batteries were fabricated for the first time. The nitrogen-doped hierarchically porous coralloid carbon (N-HPCC) with an appropriate nitrogen content (1.29wt%) was synthesized via a facile hydrothermal approach, combined with subsequent carbonization–activation. The N-HPCC/S composites prepared by a simple melt–diffusion method displayed an excellent electrochemical performance. With a high sulfur content (58wt%) in the total electrode weight, the N-HPCC/S cathode delivered a high initial discharge capacity of 1626.8mAhg−1 and remained high up to 1086.3mAhg−1 after 50 cycles at 100mAg−1, which is about 1.86 times as that of activated carbon. Particularly, the reversible discharge capacity still maintained 607.2mAhg−1 after 200 cycles even at a higher rate of 800mAg−1. The enhanced electrochemical performance was attributed to the synergetic effect between the intriguing hierarchically porous coralloid structure and appropriate nitrogen doping, which could effectively trap polysulfides, alleviate the volume expansion, enhance the electronic conductivity and improve the surface interaction between the carbon matrix and polysulfides.