A microporous–mesoporous carbon has been successfully prepared via carbonization of sucrose followed by heat treatment process. The obtained porous carbon possesses abundant micropores and mesopores, which can effectively increase the sulfur loading. The composite exhibited a remarkable initial capacity of 1185 mAh g−1 at 0.2 A g−1 and maintained at 488 mAh g−1 after 200 cycles, when employed for lithium‒sulfur batteries. Moreover, the composite displayed enhanced rate capabilities of 1124, 914 and 572 mAh g−1 at 0.2, 0.5 and 1.0 A g−1. The outstanding electrochemical capabilities and facile low‒cost preparation make the new microporous–mesoporous carbon as an excellent candidate for lithium sulfur batteries.