Detection of hydrogen peroxide (H2O2) from cell cultures is important for monitoring different diseases. Here, g-C3N4 (gCN) was incorporated into well-defined clusters of RuW (RuW-gCN) through monomer complexation of Ru-substituted phosphotungstate and melamine for electrochemical detection of H2O2. RuW-gCN exhibited enhanced electrochemical sensing properties in comparison to its constituents due to the synergic effects between RuW and gCN. The characterization of RuW-gCN revealed successful complexation to form the composite in addition to the presence of a layered structure of gCN. The electrochemical sensor made of RuW-gCN was able to detect H2O2 with a detection limit of 46 nM in the linear ranges from 100 nM to 50 μM and from 50 μM to 1 mM. The developed sensor was employed for the selective detection of H2O2 in the presence of analytes like ascorbic acid (AA), dopamine and glucose in addition to being stable even after a week of storage at room temperature. It has also been verified for real sample application by detecting H2O2 produced by cancer cells as a result of an AA trigger. © 2023 The Royal Society of Chemistry.