We demonstrate a facile preparation of novel oxidized graphitic carbon nitride (O-gC3N4) applied as an efficient electrocatalyst for highly sensitive electrochemical detection of 4-nitrophenol (4-NP) in environmental water samples. As-prepared O-gC3N4 were characterized by attenuated total reflection infrared spectroscopy, X-ray photoelectron spectroscopy, and X-ray diffraction methods for the confirmation of different functional groups and structural phase of O-gC3N4. The surface morphology of the O-gC3N4 was characterized using field emission scanning electron microscopy and high-resolution transmission electron microscopy. Results revealed that the synthesized gC3N4 possessed acid functional groups, nanosheet with porous in nature. The O-gC3N4 was drop cast on the screen-printed electrode (SPE), and it was applied for electrochemical determination of 4-NP using cyclic voltammetry and differential pulse voltammetry (DPV) techniques. The O-gC3N4/SPE exhibited excellent electrocatalytic activity towards 4-NP detection. Under the optimized experimental conditions, the DPV response of O-gC3N4/SPE showed good linear range from 0.0033 to 0.313 μM with a detection limit (S/N = 3) of 0.075 μM. The developed electrode has successfully applied for the determination of 4-NP in different environmental water samples, and the results have shown satisfied.