Among known molecular switches, spiropyrans attract considerable interest because of their reversible responsiveness to external stimuli and the deep conformational and electronic changes that characterize the switching process between the two isomeric forms [spiropyran (SP) and merocyanine (MC)]. Metal coordination is one of the most interesting aspects of spiropyrans for its potential in sensing, catalysis, and medicinal chemistry, but little is known about the details surrounding spiropyran–metal ion binding. We investigated the interplay between an N-modified 8-methoxy-6-nitrospiropyran (SP-E), designed to provide appropriate molecular flexibility and a range of competing/collaborative metal binding sites, with Mg2+, Cu2+and Zn2+, which were chosen for their similar coordination geometry preferences while differing in their hard/soft character. The formed molecular complexes were studied by means of UV/Vis, fluorescence, and NMR spectroscopies and mass spectrometry, and the crystal structure of the SP-E–Cu complex was also obtained. The results indicate that the Mg2+, Zn2+and Cu2+complexes have identical coordination stoichiometry. Furthermore, the Mg2+and Zn2+complexes display fluorescence properties in solution and visible-light responsiveness. These results provide important spectroscopic and structural information that can serve as a foundation for rational design of spiropyran-based smart materials for metal sensing and scavenging applications. © 2016 WILEY-VCH Verlag GmbH & Co. KGaA, Weinheim