This study investigates the retention mechanisms of three pharmaceuticalssulfamethoxazole, carbamazepine, and ibuprofenby nanofiltration (NF) membranes. Laboratory-scale experiments were carried out with two well-characterized NF membranes, with the goal of relating pharmaceutical retention behavior to membrane characteristics, physicochemical properties of the pharmaceutical molecules, and solution chemistry. Results show that retention of pharmaceuticals by a tight NF membrane is dominated by steric (size) exclusion, whereas both electrostatic repulsion and steric exclusion govern the retention of ionizable pharmaceuticals by a loose NF membrane. In the latter case, speciation of pharmaceuticals may lead to a dramatic change in retention as a function of pH, with much greater retention observed for ionized, negatively charged pharmaceuticals. For uncharged pharmaceutical species, intrinsic physicochemical properties of the pharmaceutical molecules can substantially affect their retention. In its neutral form, ibuprofen adsorbs considerably to the membrane because of its relatively high hydrophobicity. Similarly, polarity (represented by the dipole moment) can influence the separation of molecules that are cylindrical in shape because they can be directed to approach the membrane pores head-on due to attractive interaction between the molecule polar centers and fixed charged groups on the membrane surface. This phenomenon is probably inherent for high dipole moment organic compounds, and the governing retention mechanism remains steric in nature.