Graphene oxide (GO) electrodeposited on graphite electrode has been used as a sensor for the detection of hydroxychloroquine (HCQ). It was synthesized via a simple and low-cost electrochemical approach by exfoliation of graphite pencil core in aqueous solution of Na2SO4 using a direct current (DC) and alternating current (AC), then electrodeposited at the graphite electrode surface by cyclic voltammetry. The electrochemical performance of the DC−GO and AC−GO toward HCQ oxidation was tested. Graphene oxide (GO) and reduced graphene oxide (rGO) were characterized by UV-vis absorption spectroscopy, Fourier transform infrared spectroscopy, and X-ray powder diffraction. Cyclic voltammetry and differential pulse voltammetry were used to study the HCQ oxidation mechanism as well as electron transfer and HCQ quantification at the modified electrode AC−rGO@CPE, respectively. Parameters, such as potential range, scan rate, and the number of segments (half cycle) in cyclic voltammetry were optimized for the electrodeposition of GO. The AC−rGO@CPE shows good sensitivity toward HCQ in the range from 4.0×10−7 to 4.0×10−6 mol L−1. The detection limit was calculated to be 3.2×10−8 mol L−1 with an RSD of 3.47 %. Furthermore, the modified electrode was successfully used to detect HCQ in human urine and wastewater.