In the present study, a hyperbranched polymer demulsifier (PPDA) was synthesized by an improved “one‐pot” method with 1,4‐phenylene diamine as the central core, and ethylenediamine and methyl acrylate as the chain segments. NMR and Fourier transform infrared spectroscopy were used to confirm the molecular structure of the demulsifier, and thermogravimetric analysis was carried out to estimate its thermal stability. The effects of some important experimental parameters such as concentration, temperature and settling time on the demulsification performance were systematically studied. The results demonstrated that the light transmittance and oil removal ratio of oily wastewater reached to 47.9 % and 93.62 %, respectively, after demulsification with 20 mg.L−1 PPDA for 30 min at room temperature. With the same concentration and time at 60 °C, the light transmittance and oil removal ratio reached 57.0 % and 96.35 %, respectively. In addition, PPDA showed high salt tolerance over 10000 mg.L−1. The possible demulsification mechanism was examined by comparing the demulsification performance of different demulsifiers in diesel emulsion and oily wastewater, respectively. Furthermore, surface tension, interfacial tension, zeta potential and micrograph measurements provided convincing evidence for the possible demulsification mechanism. The surface tension reduction was 29.86 and 31.75 mN.m−1 at 25 °C and 60 °C, respectively. The corresponding critical micelle concentration was 4.17×10−7 and 5.50×10−7 mol.L−1, respectively. Additionally, the interfacial tension decreased from 15.70 to 6.96 mN.m−1 as the PPDA concentration increased from 20 mol. L−1 to 100 mol. L−1. This showed that PPDA easily absorbed at the interface and rapidly permeate into the interface film and then to broke the oil droplets. This work provides a new hyperbranched polymer demulsifier for the treatment of oily wastewater and is beneficial for understanding the demulsification mechanism.