AbstractMelatonin (MEL) is a hormone that can discharge into aquatic bodies and act as an endocrine disruptor; thus, its determination is important. In this study, a boron‐doped diamond electrode was used to develop an electroanalytical method based on square‐wave voltammetry to determine trace concentrations of MEL in river water. The electroanalytical method was developed and optimized in 0.1 mol L−1 sodium phosphate (pH=4.0) with parameters f=10 s−1, a=50 mV, and ΔES=2 mV. The validation study was carried out in the working range of 1.2–10.8 μmol L−1 using the parameters and statistical tools recommended by the validation guidelines of regulatory agencies. The matrix effect was significant; therefore, an analytical curve was directly constructed in the sample matrix by standard addition method. Results of linear regression indicated that the standard addition curve data presented a good adjust to linear model and have therefore a good linearity. Low limits of detection (0.29 μmol L−1) and quantification (0.86 μmol L−1) were observed. The estimates for precision (RSD (%)<15 %) and accuracy (mean recovery>99.5 %) were suitable according to the limits established in the literature; thus, the method was precise and accurate for the adopted working range. The study findings indicate that square‐wave voltammetry combined with a boron‐doped diamond electrode can be used for reliable and consistent determination of trace concentrations of MEL in river water. Furthermore, it presents interesting features such as lower environmental impact, speed, and low cost.