Tautomerization, the interconversion between two constitutional molecular isomers, is ubiquitous in nature1, plays a major role in chemistry2 and is perceived as an ideal switch function for emerging molecular-scale devices3. Within free-base porphyrin4, porphycene5 or phthalocyanine6, this process involves the concerted or sequential hopping of the two inner hydrogen atoms between equivalent nitrogen sites of the molecular cavity. Electronic and vibronic changes6 that result from this NH tautomerization, as well as details of the switching mechanism, were extensively studied with optical spectroscopies, even with single-molecule sensitivity7. The influence of atomic-scale variations of the molecular environment and submolecular spatial resolution of the tautomerization could only be investigated using scanning probe microscopes3,8-11, at the expense of detailed information provided by optical spectroscopies. Here, we combine these two approaches, scanning tunnelling microscopy (STM) and fluorescence spectroscopy12-15, to study the tautomerization within individual free-base phthalocyanine (H2Pc) molecules deposited on a NaCl-covered Ag(111) single-crystal surface. STM-induced fluorescence (STM-F) spectra exhibit duplicate features that we assign to the emission of the two molecular tautomers. We support this interpretation by comparing hyper-resolved fluorescence maps15-18(HRFMs) of the different spectral contributions with simulations that account for the interaction between molecular excitons and picocavity plasmons19. We identify the orientation of the molecular optical dipoles, determine the vibronic fingerprint of the tautomers and probe the influence of minute changes in their atomic-scale environment. Time-correlated fluorescence measurements allow us to monitor the tautomerization events and to associate the proton dynamics to a switching two-level system. Finally, optical spectra acquired with the tip located at a nanometre-scale distance from the molecule show that the tautomerization reaction occurs even when the tunnelling current does not pass through the molecule. Together with other observations, this remote excitation indicates that the excited state of the molecule is involved in the tautomerization reaction path.