It is of great significance for the discrimination of 2,4,6-trinitrotoluene (TNT) and 2,4,6-trinitrophenol (TNP) from their analogues. Here, based on the electron-deficient properties of TNT and TNP, a series of o-phenylenediamine/polyethyleneimine carbonized polymer dots (OPD/PEI CPDs) with different densities and types of amine groups (-NH