Nanofiltration (NF) technology is a membrane-based separation process, which has been pervasively used as the high-effective technology for drinking water treatment. In this study, a kind of composite polyamide NF thin film is selected to investigate the removal efficiencies and mechanisms of 14 trace drugs, which are commonly and frequently detected in the drinking water. The results show that the removal efficiencies of most drugs are quite high, indicating the NF is an effective technology to improve the quality of drinking water. The removal efficiencies of carbamazepine, acetaminophen, estradiol, antipyrine and isopropyl-antipyrine in ultrapure water are $78.8{\pm}0.8%$, $16.4{\pm}0.5%$, $65.4{\pm}1.8%$, $71.1{\pm}1.5%$ and $89.8{\pm}0.38%$, respectively. Their rejection rates increase with the increasing of their three-dimensional sizes, which indicates that the steric exclusion plays a significant role in removal of these five drugs. The adsorption of estradiol with the strongest hydrophobicity has been studied, which indicates that adsorption is not negligible in terms of removing this kind of hydrophobic neutral drugs by NF technology. The removal efficiencies of indomethacin, diclofenac, naproxen, ketoprofen, ibuprofen, clofibric acid, sulfamethoxazole, amoxicillin and bezafibrate in ultrapure water are $81{\pm}0.3%$, $86.3{\pm}0.5%$, $85.7{\pm}0.4%$, $93.3{\pm}0.3%$, $86.6{\pm}2.5%$, $90.6{\pm}0.4%$, $59.7{\pm}1.7%$, $80.3{\pm}1.4%$ and $80{\pm}0.5%$, respectively. For these nine drugs, their rejection rates are better than the above five drugs because they are negatively charged in ultrapure water. Meanwhile, the membrane surface presents the negative charge. Therefore, both electrostatic repulsion and steric exclusion are indispensable in removing these negatively charged drugs. This study provides helpful and scientific support of a highly effective water treatment method for removing drugs pollutants from drinking water.