A new water soluble donor–acceptor dye, sodium 4-(methyl((1E,3E)-3-(1-oxo-1H-inden-2(3H)-ylidene)prop-1-enyl)amino)benzoate (DN3) has been synthesized. Optical response of the solvatochromic dye (DN3) has been studied in various homogeneous (neat and mixed binary solvents) and heterogeneous (SDS and CTAB homomicelle and β-cyclodextrin nanocavity) media. To get information regarding the change in the solvation interaction of the dye with the alteration in its microenvironment in different media, the photophysical properties of the dye have been monitored in various media using steady state and time resolved spectral analysis. Results obtained for mixed binary solvents containing water indicate that the solute is preferentially solvated by one of the component solvents and solvent–solvent interactions are also important in determining the preference. Effect of variation of pH in aqueous medium on the spectroscopic parameters of the dye has been studied and its pKa has been estimated. Studies in homomicelles (SDS and CTAB) reveal that the dye distributes itself between the aqueous and the micellar phase and the values of distribution coefficient have been estimated from the fluorescence parameters. The dye is encapsulated in β-cyclodextrin nanocavity and a 1:2 dye-β-cyclodextrin host–guest interaction is indicated. Semi-empirical quantum chemical calculations have been carried out to support the experimental results.