Over the last decades, the treatment of the large quantities of hypersaline wastewater generated by conventional industries, inland desalination, and fossil-fueled power plants has been an important economic issue and also an inescapable green issue. Here, we developed a versatile interfacial heating membrane with alternating utilization of electricity or solar energy for hypersaline water treatment. This hierarchical membrane functions both as a separation membrane and an interface heater, which can quickly (<0.1 s) convert electricity or solar energy into heat to evaporate the outermost layer of hypersaline water. For 10 wt% hypersaline water, the freshwater production rate can reach 16.8 kg/m2·h by applying a voltage of 10 V and 1.36 kg/m2·h under 1-sun illumination. Moreover, it exhibits high electrochemical resistance to corrosion and therefore remains stable tackling hypersaline water (>5 wt%), with a high salt rejection rate of 99.99%. This system shows an efficient desalination strategy that can provide fresh water from brines for agriculture and industry, and even for daily life.