This contribution aims to design and validate a new green, cheap, and fast approach for determining the anti-GERD drug pantoprazole in different matrices. New S and N-doped carbon nanomaterials (S,N-CNMs) have been prepared via microwave irradiation of a mixture of widely available household sources. Remarkably, the utilization of a blend of carbamide and thiocarbamide with table sugar yields S,N-CNMs exhibiting the utmost quantum yield (54 %), hydrophilicity, as well as stable, homogeneous, and diminutive particle size distribution. Fourier transform infrared spectroscopy, transmission electron microscopy, spectrophotometry, and fluorescence spectroscopy were applied to characterize the S,N-CNMs. The S,N-CNMs have been used as a turn-off fluorescence probe to determine pantoprazole via a synergism of the inner filter effect and static quenching mechanisms. The fluorescence quenching is linearly correlated to pantoprazole concentration over the range of 1.0–25.0 µg/mL with a detection limit of 0.16 µg/mL. The developed probe exhibited good selectivity for pantoprazole in the presence of variability of substances. Therefore, it was applied for quality control of pantoprazole in pharmaceutical tablets and vials with an average recovery % of 100.10 ± 0.77 % and 100.33 ± 0.92 %, respectively. Moreover, it was successfully implemented to examine the content uniformity of pantoprazole in tablets. Furthermore, the prepared S,N-CNMs have been successfully used for the analysis of pantoprazole in human plasma after a simple protein precipitation step with a recovery % of 97.88 ± 5.72 %. The greenness and blueness of the developed method have been positively assessed by recent tools showing the eco-friendliness and applicability of the developed method.