Using fluorescence lifetime as the readout modality offers more reproducible and quantitative outputs compared to conventional fluorescent barcoding, being independent of sample concentration and measurement methods. Here, the authors design a photo-switchable nanogel exhibiting variable fluorescence lifetime, and demonstrate visual mapping by using fluorescence lifetime imaging microscopy on a sub-cellular scale.