This research describes the development of a new design of nanosorbents, magnetic poly(acrylonitrile-co-acrylic acid) (PAN-co-AA) nanofibers, for the pre-concentration of malachite green (MG) residues in water samples via dispersive magnetic solid phase extraction (d-MSPE) technique. After pre-concentration, the spectrophotometric method was used to determine MG. Magnetic PAN-co-AA nonwoven nanofibers was fabricated by the optimized electrospinning technique after optimization of electrospinning conditions. According to the results, increasing magnetic nanoparticles (MNPs) into polymeric matrix led to significant reduction of fiber diameter from 360 to 70nm. This change was associated with an increase in nanofibers surface area (from 9.66m2g−1 to 12.09m2g−1). Fabricated magnetic nanofibers demonstrated suitable magnetic properties (3.6emug−1), so it can be used for magnetic separation and easy extraction techniques. In the following step, magnetic PAN-co-AA nanofibers (MNFs) were used to determine MG in aquatic samples. The influence of different parameters on extraction was investigated and optimized to improve the extraction efficiency of MG. The calibration curve was linear in the range of 0.3–1.8mgL−1 of MG with R2=0.9911. The detection limit, based on three times the standard deviation of the blank, was 0.03mgL−1. The relative standard deviation (RSD) for 1, 1.5 and 1.8mgL−1 of MG was 4.31%, 6.86% and 7.68% (n=6), respectively. MG was analyzed in different water samples (urban, mineral and river waters) using the proposed method. The recoveries were 95.83–103.3% with an RSD of less than 8%. The results showed that MNFs were suitable for pre-concentration and determination of trace amount of MG in wastewater samples.