The existence of water in natural gas causes serious congestion and acid corrosion problems during exploitation and transport. Water must be removed. Here, we performed molecular dynamics simulations to investigate the effect of electric fields on natural gas dehydration through nanochannels. When the electric field is applied, only water molecules occupy the nanochannel in place of C1-C3 paraffins, acid gases and N2 molecules. The dominant mechanism is that the electric field and confinement of channels induce the ordered arrangements of water molecules, forming stable ice-like structures and restricting the entry of other components. Once removing the electric field, the water molecules will be released from the channel due to the relatively low water-channel interaction. Importantly, hydrophilic and hydrophobic channels both exhibit effective separation for water. The separation selectivity is not strictly dependent on channel diameters, avoiding the trade-off effect between adsorption capacity and selectivity based on the size sieving mechanism.