In this paper, the first part the chemical co-precipitation method was used in the preparation of magnetic nanoparticles and then application of SDS-coated Fe3O4 NPs as an adsorbent for extraction of trace amounts of terbinafine hydrochloride from pharmaceutical company wastewater was investigated. Then the drug was determined by high performance liquid chromatography with UV detection (HPLC/UV). The effects of various parameters on the extraction efficiency such as pH of solution, amount of SDS surfactant, extraction time, eluent type and desorption condithions were studied and optimized. Under the optimal conditions, the calibration curve was linear in the range of 1.0â400 ÂµgL-1 with a correlation coefficient of 0.9998. Enrichment factor of 74 and limit of detection of 0.5ÂµgL-1 were obtained. Also, the percent relative intra-day and inter-day standard deviation (R.S.D %) based on three replicate determinations were 1.0 and 3.5%, respectively. According to the results, the proposed method was successfully applied to extraction of terbinafine from environmental samples and satisfactory results were obtained.