Nanofiltration technology holds significant potential for precisely separating monovalent and multivalent ions, such as lithium (Li) and magnesium (Mg) ions, during lithium extraction from salt lakes. This study bridges a crucial gap in understanding the impact of the membrane spatial charge distribution on ionselective separation. We developed two types of mixed-charge membranes with similar pore sizes but distinct longitudinal and horizontal distributions of oppositely charged domains. The charge-mosaic membrane, synthesized and utilized for ion fractionation for the first time, achieved an exceptional water permeance of 15.4 LMH/bar and a Li/Mg selectivity of 108, outperforming the majority of published reports. Through comprehensive characterization, mathematical modeling, and machine learning methods, we provide evidence that the spatial charge distribution dominantly determines ion selectivity. The charge-mosaic structure excels by substantially promoting ion selectivity through locally enhanced Donnan effects while remaining unaffected by variations in feedwater concentration. Our findings not only demonstrate the applicability of charge-mosaic membranes to precise nanofiltration but also have profound implications for technologies demanding advanced ion selectivity, including those in the sustainable water treatment and energy storage industries.