Graphitic carbon spheres (GCSs) were prepared using glucose as the starting material. The adsorption performance of as-prepared GCSs, ammonium persulfate (AP-GCSs) and sodium dodecyl sulfate (SDS-GCSs) modified graphitic carbon spheres were investigated. More COOH, COH and SO functional groups attached on the surface of the modified GCSs compared to original counterparts, and the adsorption capacities of AP-GCSs and SDS-GCSs were 295.5 mg/g and 681.4 mg/g, respectively, which was about 1.6 and 3.7 times of that original GCSs. During the adsorption process, the adsorption sites of methylene blue (MB) (the S, N1 and N2 atoms) formed chemical bonds with S and O atoms in the oxygen-containing functional groups (COOH, COH, COOH/COH and SO4). Density functional theory (DFT) calculations revealed that the adsorption energy between MB adsorption sites (S, N1, N2) and SO4 decreased from about −4.30 to −6.38 eV for S, −3.90 to −4.67 eV for N1 and −4.74 to −6.30 eV for N2, demonstrating stronger electronic charge transferring compared with that of COOH and COH. This could be the driving force for the improved adsorption performance of the modified samples.