Abstract Herein, we have reported a simple ratiometric yellow fluorescent probe based on carbon dots for selective determination of Hg 2+ and S 2− through a fluorescence ‘ON‐OFF‐ON’ strategy. The yellow emitting nitrogen doped carbon dots (Y‐NCD's) were synthesized by prolonged thermal carbonisation of p‐hydroxy benzoic acid and citric acid dissolved in ammonia solution at 180 °C. The purified Y‐NCD's shows excitation dependent emission with maximum intensity at 550 nm showing bright yellow fluorescence when excited at 480 nm. The linear response for detection of Hg 2+ ions ranges from 0 to 260 nM with a detection limit of 27.2 nM whereas the linear range for sulphide ions is from 0 to 1.1 μM with limit of detection 0.11 μM. The proposed sensor show excellent applicability for real sample analysis with satisfactory results.