In this work, green-emission carbon dots (CDs) were prepared for detecting mercury ions (Hg(II)) and iodine ions via a facile hydrothermal method using ethylenediamine and methyl red as nitrogen and carbon sources, respectively, without any other complex reagents. The bacteriostasis experiment showed that the CDs were not toxic to the growth of four kinds of bacteria: Staphylococcus aureus (S. aureus), Bacillus subtilis (B. subtilis), Escherichia coli (E. coli), Pseudomonas aeruginosa (P. aeruginosa), which indicated that the CDs had good security and could be used for analysis and detection. The CDs exhibited excitation-independent emission, the fluorescence of which could be quenched by Hg(II), and could be recovered by iodine ions. An approach was established to detect Hg(II) based on the fluorescence quenching of CDs by the synergistic action of a photo induced electron transfer (PET) mechanism, and iodine ions were detected based on the fluorescence recovery of CDs by a HgI₂ precipitate formation mechanism. The detection limits for Hg(II) and iodine reached 0.89 μM and 0.50 μM, respectively. Compared to most methods, the method mentioned in this paper has good selectivity, a wider linear range, a lower detection limit and higher security. The synthesized CDs could be probes for sensing Hg(II) and iodine ions.