Mercury ion is a global toxic and hazardous environmental pollutant. In this work, a facile and selective ratiometric fluorescent probe was constructed for the detection of mercury ion. The dual-emissive carbon dots (BYCDs) were fabricated by a one-pot hydrothermal method utilizing o-phenylenediamine and glycine as raw materials, and the prepared BYCDs had two independent fluorescence emission peaks at 426nm and 543nm under a single excitation wavelength. Based on the change of the intensity ratio of the two fluorescence emission peaks after the addition of Hg2+, a sensitive and selective ratiometric fluorescent probe based on BYCDs was constructed for the detection of Hg2+ with good linearity ranging from 0.95-50μM and a detection limit of 0.27μM. In addition, the recovery of this probe was satisfactory in the standard addition experiments of real water samples, and it could be applied to the analysis of Hg2+ in real water samples.