Traditional demulsifiers are commonly produced using raw materials like ethylene oxide and propylene oxide, which deplete significant petroleum resources and involve hazardous and complex manufacturing processes. In this investigation, a hydrophobically modified chitosan (HMC) was synthesized by grafting dodecyl diethanolamine onto natural chitosan to facilitate the separation of O/W emulsions. Characterization of HMC was conducted using Fourier transform infrared spectroscopy (FTIR), nuclear magnetic resonance hydrogen spectroscopy (1H NMR) and scanning electron microscopy (SEM). The demulsification efficacy of HMC was assessed through a bottle test in an O/W emulsion containing 0.2 % crude oil. Results showed that at a HMC dosage of 40 mg/L, the light transmission (WT) and oil removal efficiency (WR) of the resulted water phase were 93.4 ± 0.8 % and 99.8 ± 0.1 %, respectively. Furthermore, the competitive adsorption between natural surfactants and HMC at the interface was investigated using interfacial tension (IFT), three-phase contact angle (CA), droplet coalescence time (CTA), and interfacial film substitution. A potential demulsifying mechanism was also proposed, emphasizing HMC’s hydrophilic core and dispersed hydrophobic alkyl chains that enable rapid diffusion to the oil–water interface, replacing interfacial active components to induce demulsification by destabilizing the composite film. The advantages of HMC demulsifier over commercial demulsifiers lie in its superior environmental benefits, diverse range of sources, higher efficiency, and outstanding demulsification performance.