As a basic parameter of the intracellular microenvironment, viscosity is closely related to the development of cancer. Thus, it is necessary to utilize a sensitive tool to visualize the viscosity in tumor cells and mice, which is helpful for the diagnosis of cancer. Herein, a novel dual-modal probe (IX-V) that has a near-infrared fluorescence (NIRF) and photoacoustic (PA) response to viscosity is synthesized. In low viscosity media, the probe has no fluorescence. With the increase of viscosity, the fluorescence is produced in the near-infrared region due to the inhibition of the TICT process. At the same time, the probe shows different photoacoustic (PA) signals in different viscosity media. Most notably, the viscosity in tumor cells has been imaged successfully by the application of IX-V, and the probe can effectively distinguish cancer cells from normal cells co-cultured in one dish by the difference of fluorescence intensity. In addition, the probe has been used for dual-modal imaging (NIRF and PA) of viscosity in tumor mice, which provides a tool for exploring the relationship between viscosity and diseases. That is to say, IX-V can achieve complementary imaging effects and has great application prospects in the tumor diagnosis.