ABSTRACTSelectivity for monovalent ions is a very important feature of ion exchange membranes in view of a further expansion of the scope of electrodialysis (ED). An efficient one‐step chemical process to graft a thin polyaniline (PANI) layer on the surface and pores of an ultrafiltration (UF) membrane is reported. The existence of a PANI layer on such modified UF membrane was confirmed by Fourier transform infrared spectroscopy and scanning electron microscopy images. These membranes were extensively characterized by studying their properties such as water uptake, ion‐exchange capacity, contact angle, and performance in diffusion dialysis. ED experiments were conducted by comparing desalting of sodium chloride and magnesium chloride solutions. During the desalting procedure, the driving force has two contributions, the electrical field and the salinity‐gradient. Initially, transport of ions by the electrical field is dominant, while at the end of the experiment, diffusion dialysis by the salinity gradient plays a larger role in ion transport. The presence of PANI can hinder Mg2+ transport from the concentrate to the diluate compartment because of the electrostatic effect, while there is no obvious effect on Na+ ions. The ability of such a surface modification layer to improve the membrane selectivity for Na+/Mg2+ was confirmed by means of ED in a mixed solution. The flux of Na+ was slightly increased to 13.21 × 10−8 mol/L/min while the flux of Mg2+ was reduced to 3.32 × 10−8 mol/L/min, so that the permselectivity is almost doubled. The protonation reaction of the PANI layer creates positive charges, thus leading to an electrical repulsion barrier, which may reduce the penetration of divalent cations with respect to monovalent ions. Polyacrylonitrile‐based UF membranes with different molecular cutoff was used to determine the influence of the permselectivity. Results showed that the membrane permselectivity of smaller molecular cutoff UF membranes is higher. It can be concluded that this method is suitable for preparing membranes based on UF membranes for efficient separation of monovalent ions by electro‐driven separation techniques. © 2017 Wiley Periodicals, Inc. J. Appl. Polym. Sci. 2018, 135, 45692.