Abstract In this work, the photochromic compound 1′,3′,3′-trimethyl-6-nitrospiro (2H-1-benzopyran-2,2′-indoline) (NOSP) was synthesized by a two step process. The photochromic properties of NOSP were investigated by ultraviolet–visible (UV–Vis) spectrophotometry. The results showed that NOSP was very sensitive to UV irradiation with absorption peaks at about 336nm and 567nm. Our hypothesis was that both photochromic nanofibers and photochromic living animal cells could be obtained by combining them with NOSP. To test the hypothesis, photochromic nanofibers were fabricated by electrospinning from various mixed solutions of NOSP and polymers (including a synthetic polymer of poly(methyl methacrylate) and a natural polymer of gelatin); NOSP/ethanol solution was dissolved in culture medium to stain pig iliac endothelial cells (PIEC) and endow them with photochromic capability. Polymer nanofibers from electrospinning were characterized by water contact angle measurements, ultraviolet–visible (UV–Vis) spectrophotometry and fluorescence microscopy. Morphology of photochromic PIEC was observed by fluorescence microscopy after being irradiated. It was shown that nanofibers from electrospun polymers and NOSP-treated PIEC had photochromic properties. The bio-toxicity of the photochromic compound was also evaluated and it was shown that ∼50% of PIEC remained viable for at least 20min. The photochromic compound NOSP could be a potentially powerful tool for development of multi-functional nanofibers and biological applications.