A novel method for the preparation of highly mesoporous carbon materials (Kroll-Carbons; KCs) is described based on reactive carbochlorination etching of titania nanoparticles inside a dense carbon matrix leading to mesoporous carbons with precisely controllable porosity and high performance as cathode materials for lithium-sulphur (Li-S) batteries.