Membrane-based separations for water purification and desalination have been increasingly applied to address the global challenges of water scarcity and the pollution of aquatic environments. However, progress in water purification membranes has been constrained by the inherent limitations of conventional membrane materials. Recent advances in methods for controlling the structure and chemical functionality in polymer films can potentially lead to new classes of membranes for water purification. In this Review, we first discuss the state of the art of existing membrane technologies for water purification and desalination, highlight their inherent limitations and establish the urgent requirements for next-generation membranes. We then describe molecular-level design approaches towards fabricating highly selective membranes, focusing on novel materials such as aquaporin, synthetic nanochannels, graphene and self-assembled block copolymers and small molecules. Finally, we highlight promising membrane surface modification approaches that minimize interfacial interactions and enhance fouling resistance.