materials are candidates for use in advanced molecular separation and water treatment. Among them, MXenes are cutting-edge two-dimensional (2D) materials with favorable properties such as high hydrophilicity, adjustable interlayer spacing, high mechanical strength, and structural stability. Therefore, they can be used to construct advanced lamellar membranes to ensure enhanced separation performance of modified membranes. Here, we prepared novel stable lamellar membranes through electrostatic attraction between polycation polyethyleneimine (PEI) and a negatively charged MXene, with hydrogen bond formation between their functional groups. By changing the pH of the suspension, the interlayer d-spacing of the prepared membrane could be altered to achieve precise molecular separation and ultrahigh organic solvent penetration. Furthermore, inserting PEI into the interlayer d-spacing of the membrane did not hinder the passage of water molecules. The prepared pH = 2-MXene-PEI membrane for dyes larger than 1.5 nm exhibited a rejection rate of greater than 96%, and the pH = 10-MXene-PEI membrane had a rejection rate of greater than 96% for dyes larger than 1.6 nm. In addition, the optimized MXene-PEI membranes showed channel stability. In this work, high-performance, stable, 2D MXene-PEI membranes with tunable nanochannels were developed. These membranes have great potential for use in precise molecular separation applications.