A novel honeycomb-like nitrogen and oxygen dual-doped porous carbon (NOPC) has been successfully fabricated by using biomass waste (soybean residue) as the precursor through facile carbonization and activation. Instrumental analysis shows that the obtained NOPC possesses a special hierarchical porous carbon structure, large specific surface area (2690.3m2 g−1), high pore volume (1.34cm3 g−1) and appropriate N and O co-doping. The NOPC is then used to synthesize the NOPC-sulfur (NOPC/S) composite as the cathode material of lithium-sulfur batteries for the first time. The NOPC/S composite with 64.5wt% sulfur content delivers a high initial discharge capacity of 1185.4mAhg−1 at 0.2C and a good rate capability (482.7mAhg−1 at 2C). When cycling at 1C, the first and the 600th discharge capacities of 698.5mAhg−1 and 435.7mAhg−1 are retained, respectively, along with a low decay rate of 0.063% per cycle. The superior electrochemical property is primarily attributed to the synergistic effect of the hierarchical porous structure and in-situ N and O co-doping, which can effectively sequestrate the soluble lithium polysulfides by combining physical confinement and strong chemical adsorption.