Temozolomide (TMZ) is one of the most effective anticancer drug and higher the risk of side effects, used in overdosage in cancer treatment. It is a major concern to determine the appropriate level of the anticancer drug by a more conventional method. In the present study, the first developed 2D− 2D interface of rich oxygen vacancies of WO3 −x and sulfur-doped g-C3N4 nanosheets hybrids composites (2D–2D/RWNs-SCN) was synthesized using a facial microwave-assisted route to detection of temozolomide (TMZ) in pharmaceutical sample. The samples’ morphological, two-dimensional rich oxygen vacancies of WO3 −x nanosheets (2D RWNs) and sulfur-doped g-C3N4 nanosheets (2D SCN) were investigated using field emission-scanning electron microscopes (FE-SEM). The 2D–2D/RWNs-SCN modified screen-printed carbon electrodes (SPCEs) were utilized for reducing TMZ in a 0.1 M phosphate-buffered solution (pH 7.0). The 2D–2D/RWNs-SCN achieved a higher reduction current against TMZ than the bare SPCE, CN/SPCE, SCN/NSs/SPCE, and 2D RWNs/SPCE. With optimized sensing parameters, the limit of detection was estimated to be 0.0019 μM, with a high sensitivity of 18.2855 μA μM− 1 cm− 2. To corroborate our experimental observations qualitatively, we have first time performed detailed density functional theory simulations to explore the charge transfer and bonding mechanism of TMZ on 2D RWNs and 2D–2D/RWNs-SCN surface. The higher binding energy of TMZ and enhanced charge transfer from TMZ to 2D–2D/RWNs-SCN owing to the 2D–2D interface possess superior charge-transfer kinetics, resulting in higher TMZ sensing performance, which supports our experimental observations. The hybrid nanocomposites are successfully applied to the determination of TMZ in the presence of pharmaceutical samples.