Stabilized water-in-oil emulsions present significant challenges for oil production. However, current demulsifiers often face limitations such as high demulsification temperatures, low efficiencies, and complex synthesis processes, making the resolution of this challenge a demanding task. In this study, we successfully synthesized two ionic liquid demulsifiers, PEDA-Br and GEDA-Br, employing a straightforward two-step procedure. The objective was to enable effective treatment of water-in-oil emulsions at low temperatures with high efficiency. The structure of the demulsifiers was characterized utilizing Fourier-transform infrared spectroscopy (FT-IR) and nuclear magnetic resonance hydrogen spectra (1H NMR). Bottle tests were then conducted to evaluate their demulsification efficiency (DE) in water-in-oil (W/O) emulsions. The results demonstrated that GEDA-Br achieved a DE of 98.92 % at a concentration of 500 mg/L and a temperature of 50 °C after 2 h. Additionally, both PEDA-Br and GEDA-Br exhibited DE values exceeding 95 % at a salinity level of 10,000 mg/L, and both proved effective across a broad pH range of 4 to 12. These findings highlight their robust resistance to high salinity and both acidic and alkaline conditions. The study also examined the demulsification mechanism in terms of interfacial tension (IFT), elastic modulus of the interfacial film, three-phase contact angle (TCA), and microscopic observations. The excellent interfacial activity, ability to reduce interfacial tension, and electrostatic neutralization capability are responsible for its outstanding demulsification performance.