A ratiometric fluorescent sensor was developed for detecting biothiols in water and biological samples such as urine and serum. For this sensor, the monomer–excimer emission variations were regulated by aggregation and deaggregation via the complexation between pyrene–thymine and mercury ions modulated by biothiols.