A new class of membranes that can separate ions of similar size and charge is highly desired for resource recovery, water reuse and energy storage technologies. These separations require membrane nanochannels with simultaneous ångström-scale confinement and ion-selective binding sites. Conventional membrane material design uses continuous, volume-averaged properties that cannot account for discrete chemical interactions between ions and binding sites. In this Perspective, we present a design framework for ultraselective membranes by describing how to select and incorporate ion-specific binding sites into membrane nanochannels. We begin by discussing how the chemical features of ions, functional groups and solvents impact ion-binding energy. We then describe the role of binding energy in selective ion transport through nanochannels and discuss the critical importance of intersite spacing. Subsequently, we draw inspiration from machine learning methods used for drug discovery and suggest a similar approach to identify functional groups with optimal ion-binding affinity. We conclude by outlining synthetic methods to incorporate ion-specific binding sites into prevalent nanostructured materials such as covalent organic frameworks, metal–organic frameworks, two-dimensional materials and polymers.