Converting more CO2 absorbed by plant photosynthesis into biomass-activated carbon effectively reduces carbon emissions. In this study, we used a one-step preparation of biomass-activated carbon loaded with MgO nanoparticles to investigate the effect of Mg loading on the catalytic pyrolysis process. The influences of magnesium loading on biochar yield and fixed carbon production were assessed. The addition of 1% Mg weakened the carbonyl C=O, inhibited the dehydroxylation reaction, enhanced the C-H signal strength, and the formation of MgO inhibited the weaker- bound substituent breakage. Additionally, the addition of magnesium altered the morphological features and chemical composition of the biochar material. It also increased the activated carbon mesoporosity by 3.94%, biochar yield by 5.55%, and fixed carbon yield by 12.14%. The addition of 1% Mg increased the adsorption capacity of the activated carbon to potassium dichromate, acid magenta, methylene blue, and tetracycline effluents by 8.71 mg, 37.15 mg, 117.68 mg, and 3.53 mg, respectively. The results showed that MgCl2 played a significant role in promoting the thermal degradation of biomass and improving the solid yield and adsorption performance of activated carbon.