Worldwide industrialization has grown at a rapid pace, contaminating water resources, particularly with phenolic pollutants that pose a risk to aquatic systems and human health. The goal of this study is to create an inexpensive magnetic composite that can effectively remove nitrophenol (o-NP) using adsorptive means. In this instance, a nonanyl chitosan (N-Cs) derivative was synthesized and then combined with activated petroleum coke (AP-coke) and magnetic Fe3O4 to boost its adsorbability towards o-NP and to facilitate its separation. Fourier transform infrared spectroscopy (FTIR), scanning electron microscopy (SEM), X-ray diffractometer (XRD), Vibrating sample magnetometer (VSM), X-ray photoelectron spectroscopy (XPS), and zeta potential were employed to characterize the magnetic composite. The experimental results indicated that the Fe3O4/AP-coke/N-Cs composite possesses a greater affinity toward o-NP with a maximal efficiency reached 88% compared to 22.8, 31.2, and 45.8% for Fe3O4, AP-coke and N-Cs, respectively. The equilibrium adsorption data coincided with the Langmuir, Freundlich, and Temkin isotherm models, with a maximum adsorption capacity of 291.55 mg/g at pH 6, whereas the pseudo second order kinetic model offered the best fit to the experimental data. Besides, the developed adsorbent preserved satisfactory adsorption characteristics after reuse for five successive cycles. The proposed adsorption mechanism involves the H-bonding, π-π interaction, hydrophobic interactions and electron donor-acceptor interactions. These findings hypothesize that the constructed magnetic composite could efficiently remove nitrophenols from polluted water with high performance and ease-separation.