This study aimed to investigate the synthesis of polyaniline (PANI) through electrochemical cyclic voltammetry at varying pH levels and its subsequent adsorption behavior towards Congo red. The products were analyzed using Fourier Transform-infrared spectroscopy (FTIR) and Scanning Electron Microscope (SEM). Results showed that acidic conditions led to faster synthesis rates and complete planes with intercalated flakes, while neutral and alkaline conditions resulted in mostly granular aggregates. PANI synthesized with the maximum adsorption capacity is 58.07[Formula: see text]mg/g. The interaction between PANI and Congo red occurred through protonation-induced positive charges and electrostatic attraction, as indicated by UV–Vis spectroscopy results. The adsorption process followed the Langmuir model and pseudo-second-order kinetic process, indicating a chemical adsorption process. This study emphasizes the significance of pH conditions in polyaniline synthesis and its potential application in dye removal processes.