A polymer nanoparticle-based ratiometric fluorescent probe (PN) for selectively detecting Hg2+ has been developed. The probe shows good water dispersibility, excellent long-term photostability and low cytotoxicity. The detection limit of probe is 75 nM. The probe can be used to image Hg2+ in living cells.