Design and synthesis of metal-free, cost-effective, and ecofriendly nanostructured materials are of great importance for optoelectronic and electrochemical applications. In this study, we have synthesized metal-free sulfur-doped graphitic-carbon nitride (S@g-C 3 N 4 ) by poly-condensation process. The synthesized S@g-C 3 N 4 was authenticated by various advanced characterization techniques. Further, glassy carbon electrode was modified with S@g-C 3 N 4 which acted as hydrazine sensor. This developed hydrazine sensor exhibited excellent detection limit of 0.98 µM with sensitivity of 1.81 µA µM −1 cm −2 . Furthermore, synthesized S@g-C 3 N 4 was also explored as photo-catalyst for the generation of hydrogen (H 2 ) using photo-catalysis process. The S@g-C 3 N 4 exhibited excellent hydrogen production of 6547 µmol g −1 which suggested presence of excellent catalytic properties in S@g-C 3 N 4 . • Cost-effective, and ecofriendly sulfur doped g-C 3 N 4 was synthesized. • Hydrazine sensor was developed using sulfur doped g-C 3 N 4 as electro-catalysts. • Hydrazine sensor showed excellent detection limit and selectivity. • H 2 generation was carried out using sulfur doped g-C 3 N 4.