In this study, a novel resonance light scattering (RLS) sensor was synthesized using polyacrylonitrile nanofibers decorated with magnetic carbon dots (MCDs@NFs) nanocomposite and applied for famotidine (FMD) determination. The MCDs@NFs nanocomposite was synthesized by combining electrospinning and a simple one-step hydrothermal method. Different methods were applied in order to characterize the MCDs@NFs nanocomposite such as: scanning electron microscopy (SEM), Fourier-transform infrared spectroscopy (FT-IR), Transmission electron microscopy (TEM), X-ray photoelectron spectroscopy (XPS), and X-ray diffraction (XRD). Light scattering properties of the synthesized nanocomposite in the presence or absence of FMD have been selected as the detection signal considering the fact that FMD addition increases the RLS intensities of the system. Thus, the prepared nanocomposite was employed as a RLS sensor to detect FMD. A linear response was observed under the optimal conditions in range of 0.15–50.0 μmol L−1 with detection limit of 0.04 μmol L−1. The MCDs@NFs nanocomposite was effectively capable in determining FMD in real samples and the results were close to those results obtained by reversed-phase HPLC method (RP-HPLC). © 2018 Elsevier B.V.