Fluorescent sensors with selectivity and sensitivity to metal ions are an active field in supramolecular chemistry for biochemical, analytical, and environmental problems. Mg 2+ is one of the most abundant divalent ions in the cell, and it plays a critical role in many biological processes. Coumarin-based sensors are widely used as desirable fluorophore and binding moieties showing a remarkable sensitivity and fluorometric enhancement for Mg 2+ . In this work, density functional theory/ multireference configuration interaction (DFT/MRCI) calculations were performed in order to understand the sensing behavior of the organic fluorescent sensor 7-hydroxy-4-methyl-8-((2-(pyridin-2-yl)hydrazono)methyl)-2H-chromen-2-one (PyHC) in ethanol to solvated Mg 2+ ions. The computed optical properties reproduce well-reported experimental data. Our results suggest that after photoexcitation of the free PyHC, a photoinduced electron transfer (PET) mechanism may compete with the fluorescence decay to the ground state. In contrast, this PET channel is no longer available in the complex with Mg 2+ making the emissive decay more efficient.