Detecting butylated hydroxyanisole (BHA) in food, and other substances is critical for human health, as it is poisonous to cells. In this study, o-phenylenediamine (o-PDA) was electropolymerized over a glassy carbon electrode (GCE) decorated with gold nanoparticles (GNPs) and multiwalled carbon nanotubes (MWCNTs) to construct an electrochemical sensor for BHA detection. The structural characterization of the produced sensor was analyzed using scanning electron microscopy (SEM), atomic force microscopy (AFM), differential pulse voltammetry (DPV), cyclic voltammetry (CV), and electrochemical impedance spectroscopy (EIS). Under ideal conditions, the linear response range of the proposed sensor was 0.01 mu M to 5 mu M and 5 mu M to 1000 mu M, with an ultra-low detection limit of 6 nM. Furthermore, the sensor demostrated excellent stability, selectivity, repeatability, and reproducibility. It was successfully used to detect BHA in mayonnaise, black cumin oil, and soybean oil, with recoveries ranging from 97.96% to 102.66% and relative standard deviations (RSDs) less than 2.11%, indicating that BHA detection in actual samples is both possible and accurate.