Hypertension and high blood pressure are significant global health issues, with increasing reliance on nifedipine for treatment. However, excessive use of nifedipine (NIF) poses serious risks to human health, the environment, and aquatic life, necessitating precise monitoring. This study reports the synthesis of two-dimensional Tin Tungsten Oxide (2D-TTO) heterojunction nanosheets via a solvothermal method followed by ultra-probe sonication, and their application as a fluorescence sensor for sensitive and selective detection of NIF. The photoluminescence (PL) analysis of 2D-TTO nanosheets revealed stable bluish-green fluorescence at 442 nm (λem) when excited at 360 nm (λex). After the characterization and optimization for the nanomaterials, the 2D-TTO fluorescence nanosheets were utilized to quantify NIF through fluorescence quenching. The NIF successfully quenched the fluorescence via the combination of electron and energy transfer mechanisms. The sensor achieved a detection limit (LOD) of 7.2 nM with excellent linearity (R2 = 0.9979). Real-world applicability was validated using spiked human urine, river water, and pharmaceutical samples, demonstrating recovery rates of 95–106 %. These findings have demonstrated the power of heterojunction 2D-TTO nanosheets to act as a novel, label-free fluorescent sensor for accurate and reliable NIF detection in biological, environmental, and pharmaceutical samples, offering a superior method compared with the traditional dye-based fluorescence nanosensors or any other current liquid/solution state nanosensors as the 2D-TTO sensor is a solid-state nanosensor that is much more stable than those of the zero-dimensional nanosensors such as quantum dots or nanoclusters.