The invention discloses a method for preparing fluorescent carbon dots by pyrolyzing ammonium carboxylate .The method includes the following steps that 1, polycarboxylic acid is dissolved in deionized water, ultrasonic oscillation is carried out, diamine is added for a reaction under nitrogen protection, a reaction product is washed with petroleum ether after the reaction is complete, an aqueous layer is separated out, reduced-pressure rotary evaporation is carried out to remove unreacted diamine, and a yellow solid is obtained; 2, the yellow solid is put into a tube furnace and heated under nitrogen protection, grinding is carried out after heat preservation, and black powder is obtained; 3, the black powder is dissolved in absolute ethyl alcohol, dialysis is carried out with a dialysis bag, a solution outside the dialysis bag is subjected to rotary evaporation, and the fluorescent carbon dots are obtained .The preparation method is easy to implement, raw materials are easy to get, cost is low, no environmental pollutant is released in the preparation process, and the preparation method is an environment-friendly preparation technology; the mean grain size of the fluorescent carbon dots prepared with the method is 11 nm, water solubility is good, fluorescence is stable, the fluorescence quantum yield reaches 22.46%, and the fluorescent carbon dots can be applied to Fe3+ detection.