Dehydration is a basic phenomenon in ion transport through confined nanochannels, but how it affects ion trans-membrane selectivity has not been understood due to a lack of characterization techniques and suitable pore structures. Herein, hydration number distributions of typical alkali metal ions were characterized by combining uniform subnanochannels of ZIF-8-based membranes with the in situ liquid time-of-flight secondary ion mass spectrometry (ToF-SIMS) technique, revealing that steric hindrance induced ion dehydration through neutral confined ZIF-8 windows. The reduction in size due to partial dehydration increased the intrapore velocity for monovalent cations. The highest entropy value with maximum size changes resulting from dehydration drove fast and efficient selective transport of Li+ over other alkaline metal ions, leading to a Li+/Rb+ selectivity of 5.2. The dehydration at the entrance of membrane pores was shown to account for the majority of overall barriers, being a dominant element for ion transport. High hydration energy (>1500 kJ/mol) hindered the dehydration and transport of typical alkaline earth metal ions, achieving ultrahigh monovalent/bivalent cation selectivity (∼104). These findings uncover the crucial role of dehydration energy barriers and size-based entropy barriers in ion selectivity of trans-subnanochannel transport, providing guidelines for designing selective membranes with specific pore sizes to promote the dehydration of desired solutes.