This work provides a method to transform sodium lignosulfonate into sulfonated carbon materials through chemical activation using magnesium salt as a template instead of using conventional sulfonation agents, such as concentrated sulfuric acid or chlorosulfonic acid. Several magnesium salts, including magnesium nitrate, magnesium chloride, magnesium acetate, and magnesium citrate, are employed as activating templates for comparison, and magnesium nitrate turns out with the most abundant sulfonic acid group density of 1.35 mmol/g and highest specific surface area of 512 m 2 /g. Especially, the effect of magnesium salts during carbonization process on the structure evolution is explored using tandem thermogravimetric-mass spectrometry and reveals that magnesium nitrate prevents sulfur loss in the form of SO 2 , SO 3 , or H 2 S during carbonization, thus exhibiting the most abundant sulfonic acid group. These sulfonated carbon materials are tested in the alkylation reaction of furfural and 2-methylfuran to produce a C15 precursor of biodiesel, where the conversion of furfural and selectivity for 5,5-(furan-2-ylmethylene)bis(2-methylfuran) reach 90.2% and 87.2% at 70 °C for 6 h, respectively. This investigation underscores the efficient utilization of sulfonic acid functional groups inherent in sodium lignosulfonate to produce sulfonated carbon materials without the introduction of an exterior sulfur source and opens avenues for a broader application of lignosulfonates.