In this paper, the carbon dots (CDs) with strong blue fluorescence were synthesized through hydrothermal method, which using folic acid, ammonium citrate and ethylenediamine as precursors. The prepared CDs with a high absolute quantum yield of 81.94% and showed excellent stability in high concentration salt solution and different pH conditions. With the addition of Hg2+, the signal of CDs was selectively quenched. At the same time, the CDs-Hg2+ system could be recovered after the introduction of biothiols. Moreover, the fluorescence of CDs showed a good linear relationship with Hg2+ (1-15 µM), and the detection limit as low as 0.08 µM. In addition, the prepared CDs with low toxicity could be used to detect Hg2+ in living cells and actual water samples.