BackgroundAniline serves as a pivotal precursor in many industries such as pesticides, pharmaceuticals, and chemicals. However, its ingestion can lead to severe health consequences, including the potential to induce cancer, respiratory tract irritation, and adverse effects on the nervous and digestive systems in the human body. The widespread use of aniline in industrial processes, coupled with inadequate wastewater management that allows for the direct release of aniline into the environment, leads to surface and groundwater contamination. Therefore, it becomes crucial to devise a reliable electrochemical sensor capable of detecting even trace amounts of aniline. ResultsThis study presents a modified polyol synthesis method for producing silver nanorods (AgNRs, length: 861–1345 nm, diameter: 66–107 nm) with preferential growth along the (111) crystal plane. Immobilizing AgNRs on a glassy carbon (GC) electrode with Nafion as a binder decreases its charge transfer resistance from 3040 to 129 kΩ and increases its electroactive area from 0.034 to 0.101 cm2. AgNRs/GC electrode exhibited an aniline detection limit of 0.032 μM and sensitivity of 1.4841 μA.M−1cm−2 within a linear range of 0–10 μM using square wave voltammetry (SWV). The reaction rate constant of aniline sensing was determined to be 0.08697 s−1. Chlorobenzene, acephate, and chlorpyrifos could not interfere aniline detection, and 26 % decrease in peak response was observed after the 10th cycle of aniline sensing. The sensor demonstrated ∼100 % recovery for aniline, comparable to the performance of high-performance liquid chromatography when applied to real-world samples like tap and river water. SignificanceThe electrochemical sensing of aniline is notably efficient in tap and river water within the acceptable limit, by utilizing one dimensional AgNRs functionalized GC electrode. Importantly, the presence of interferents does not compromise the sensitivity of the sensor. Therefore, one dimensional AgNRs synthesized via a modified polyol route emerge as a promising electrocatalyst for the in-situ detection and determination of aniline.