In this work, heteroatom (B and N) doped carbon quantum dots (CQDs) materials were synthesized via facile hydrothermal method using o-phenylenediamine (o-PD) as a nitrogen source and 3-aminophenyl boronic acid (3APBA) as a boron source. The synthesis parameters were optimized and optimal synthesis temperature and reaction time were 260 °C and 2 h, respectively. The chemical structures were characterized using various techniques. The experimental results showed that B,N co-doped CQDs had the strongest fluorescence intensity when the weight ratio of 3APBA:o-PD was 3:1 and showed a phenomenal quantum yield of 59% with high selectivity for Fe3+ and Hg2+ ions, with quenching constants 1.25 × 103 M–1 and 8.3 × 103 M–1, respectively. The high fluorescence quenching was attributed to the photoinduced electron transfer phenomenon, making it suitable for fluorescent sensing materials. Cytotoxicity data revealed synthesized materials are safe for biomedical applications within a 1–10 µg/mL concentration.