Spiropyrans (SPs) are an important group of photochromic compounds with a wide range of applications. In order to effectively design and utilize these photoswitches, it is necessary to understand how the photochromic properties are affected by substituents with different electron withdrawing or donating power, and solvents. In this work, the photophysical properties and mechanism of molecular switching in spiropyran derivatives SP-X1-7 (X1-7 = H, NO2, CF3, CN, OH, OMe and NMe2) was investigated at GD3-TD-CAM-B3LYP/6-31 G(d) level of theory in the ground and excited states in the gas phase and three solvent media. According to obtained results, the energy barrier in the excited states was lower than that found in the ground state, showing that the process of photo-switching in the excited state is faster than the ground state. Our results showed that SP to merocyanine (MC) switching process could be divided into two steps: elongation of C-spiro-O distance to reach the cis-MC structure and, in turn, rotation around the central torsion angle to touch the trans-MC structure. The results showed that the first step is the rate-determining step of SP to trans-MC isomerization. In addition, solvent and substituent effects, photophysical properties, structural parameters, relative energies, and natural bond orbital (NBO) data were explored in detail.