A highly mesoporous carbon foam with oxygen-containing functional groups is chemically tailored from abandoned ion exchange resin, and prepared carbon foam/S composite with 68.7% sulfur is prepared for lithium‑sulfur (Li-S) batteries cathode. The prepared carbon foam possesses 3D structure with oxygen-containing functional groups, highly specific surface area (1648.63m2 g−1)and a centered pore size distribution, which is due to the rational chemically tailoring strategy. The obtained carbon foam/S composite delivers a 841.2mAhg−1 large reversible discharge capacity after 100cycles at 0.5C charge–discharge rate. The outstanding electrochemical properties can be attributed to the synergistic effect of unique 3D network structure, highly mesoporous and oxygen-containing functional groups during chemically tailoring process.