This study investigates the potential of cobalt ferrite-doped mango seed shell (CoFe2O4-MSS) as an innovative and eco-friendly approach for the treatment of crude oil-polluted water. CoFe2O4-MSS was synthesized by impregnating carbonized mango seed shell with cobalt ferrite nanoparticles through thermal precipitation. The study systematically evaluated the adsorption capacity, kinetics, and isotherm behavior of the developed material using standard equations. Experimental results demonstrate the effectiveness of the cobalt ferrite-doped mango seed shell in adsorbing crude oil components, with high removal efficiency of 98.3% at 80 °C after 50 min. The crystallite sizes of raw mango seed shell and CoFe2O4-MSS are 31.8 nm and 21.3 nm, respectively. The calculated adsorption capacity stood at 55.50 mg/g, the Brunauer–Emmett–Teller surface area of CoFe2O4-MSS was 1007.4m2/g with a porosity distribution of 1.685 $$\eta$$
η
while the volume and pore diameter are 3.104m3/g and 7.212 nm, respectively. FTIR analysis revealed the presence of aliphatic, aromatic, and silicon compounds. The isotherm data matched well with Langmuir isotherm model while kinetic data fitted well with Bhattacharya–Venkobachar model. The unique properties of cobalt ferrite, a magnetic and iron-based material, combined with the abundant and biodegradable nature of mango seed shells, make this composite an attractive adsorbent for removing crude oil contaminants. This research contributes to the development of sustainable and cost-effective solutions for addressing environmental challenges posed by crude oil pollution. Also, this research has contributed immensely to the sustainable development goals of the united nation (UN-SDG) regarding environmental protection.