Highly luminescent carbon quantum dots (CQDs) are developed as fluorescent probes for selective detection of the heavy-ion Fe3+, where the CQDs exhibit excellent nontoxicity, functionalizability, sensitivity, and selectivity. Biomass-based CQDs and nitrogen-doped CQDs (N-CQDs) are synthesized for the selective detection of Fe3+ by using H2O2 as an oxidant and polyetherimide (PEI) as a nitrogen precursor by a green hydrothermal synthesis method. The prepared CQDs and N-CQDs exhibit an elliptical morphology and with an average particle size of 7 and 4 nm, respectively, and emit blue photoluminescence at 445 and 468 nm under excitation at 367 and 343 nm, respectively. The CQDs and N-CQDs exhibit good water solubility because of the abundant hydroxyl and carboxyl/carbonyl groups and graphic/pyrrolic/pyridinic nitrogen on the surfaces, giving rise to a quantum yield of about 24.2% and 30.7%, respectively. Notably, the Matrimony vine-PEI-based CQDs exhibit excellent Fe3+ selectivity and sensitivity relative to the Matrimony vine-based CQDs due to complexation of the numerous phenolic hydroxyl groups and nitrogen-containing groups with Fe3+, leading to increased fluorescence quenching, which greatly improves the sensitivity of detection. The minimum detection limit was 2.22 μmol L− 1 with a complexation constant of 44.7.