Mesoporous carbon (MC) materials with large pore volume and high surface area have been synthesized as the conductive matrix in the sulfur cathode for the lithium sulfur (Li/S) batteries using a simultaneous templating and carbonization method. The magnesium citrate is used as the precursor of the carbon and provides nanometer sized MgO particles template. Wide-angle X-ray diffraction (WA-XRD), high-resolution transmission electron microscopy (HR-TEM) and N2 sorption analysis show that the resultant carbon material possesses mesopores structure (about 6.5nm), high surface area (1432 m2 g−1), and large pore volumes (2.894 cm3 g−1) after pyrolysis (1000°C). Elemental maps confirm that sulfur is homogeneously dispersed in the MC framework after encapsulation. Electrochemical measurements performed on this mesoporous carbon used as an electrode material for Li/S batteries show excellent discharge capacity (1083.6 mAh g−1) at current density 200mAg−1. The mesopores with large volume and high surface area are crucial in loading insulated sulfur, which provide enough space and good conducting networks for active materials. Meanwhile, mesoporous structure with high adsorption capacity can both effectively accommodate the polysulfide anions and improve the electrochemical performance of Li/S batteries.