Endosulfan is an organochlorine pesticide widely used in agriculture to protect crops such as cotton, soybeans, coffee, tea, cereals, fruits, vegetables, and grains from pests. However, exposure to low concentrations of endosulfan causes harmful effects on humans' health. Therefore, the determination of endosulfan in food samples by a fast, simple, and cost-effective method is pivotal. In this study, an electrochemical sensor based on a polyaniline/Fe-ZnO-modified glassy carbon electrode (PANI/Fe-ZnO/GCE) was developed for the determination of endosulfan in vegetables. The synthesized nanomaterials were characterized by Fourier transform infrared (FT-IR), X-ray diffraction (XRD), and scanning electron microscopy (SEM). PANI/Fe-ZnO/GCE showed remarkable electrocatalytic activity for the determination of endosulfan in vegetables. It also exhibited a good linear response to endosulfan concentrations ranging from 1 to 400 mu M. The method displayed a low detection limit (LOD) of 0.003 mu M. The sensor showed good selectivity, long-term stability, good repeatability, and within-lab reproducibility. It was also applied for the determination of endosulfan in tomatoes and potatoes, with acceptable recoveries ranging from 87.00 to 96.80%.Graphical abstractGraphical illustration of PANI/Fe-ZnO modified glassy carbon electrode for endosulfan determination in vegetables