Heteroatom-doping carbon dots (CDs) have excellent fluorescence properties. In the paper, nitrogen (N) and phosphorus (P) co-doped CDs (N, P-CDs) were prepared through the hydrothermal method and characterized by TEM, PXRD, FT-IR, 13C NMR, XPS, UV–vis, and fluorescence spectra. The optical properties and drug (doxorubicin) - delivery performance of N, P-CDs were also studied. The results showed that the average size of N, P-CDs was 3.64 nm and the quantum yield was 30 %. The N, P-CDs had down- and up-conversion fluorescence properties, and the luminescence mechanism of the N, P-CDs was explained. The drug loading capacity of N, P-CDs was 39.11 %, and the drug delivery system (N, P-CDs-DOX) had low cytotoxicity, sustained release, and pH-targeted properties. The in vitro release of N, P-CDs-DOX belonged to the Weibull model and Fick diffusion, exhibiting the same release model and mechanism with free DOX. The N, P-CDs could deliver DOX successfully, which was demonstrated by the co-collocation of N, P-CDs and DOX in SH-SY5Y cells through single/two-photon imaging. N, P-CDs could potentially be used in drug-targeted delivery and cell imaging.