Herein, an effective template assisted calcination procedure has been adopted to synthesize the Sulphur-doped graphitic carbon nitride (S X GCN). Furthermore, the S X GCN/GCE was then utilized for the electrochemical determination of 2,4-Dinitrophenol (2,4-DNP). It has been inferred that among the variously prepared S X GCN (x = 0 %, 20 %, 40 %, 60 %, 80 %, and 100 %), S 80 GCN afforded the excellent electrochemical response for detection of 2,4-DNP. The synthesized S X GCN/GCE (x = 80 %) demonstrates with a low detection limit of 0.9083 μM with linear range of 1-90 μM. Furthermore, the practical application of this sensor was successfully proved by detecting spiked 2,4-dinitrophenol in a real gym supplements sample.