Herein, nitrogen-and phosphorus-doped carbon quantum dots (CQDs) are synthesized using a one-step hydrothermal method that uses glucose and diammonium phosphate as the main raw material to improve bottleneck problems, such as low yield of fluorescent quantum, short-emission wavelength, and the poor photoelectrical performance of CQDs. The optimal synthesis conditions are found to be a duration of 10 h, optimal synthesis temperature of 240 °C, and optimal raw material ratio of glucose: diammonium phosphate as 3:0.5. The shape, composition, optical properties, and electrochemical properties of the nitrogen-and phosphorus-doped CQDs (N,P-CQDs) are characterized and studied by means of instruments. The experimental results show that the N,P-CQDs prepared following the hydrothermal method using glucose and diammonium phosphate as the main raw material produce a higher fluorescence quantum yield (41.7%), longeremission wavelength (470 nm), and better photoelectric properties, expanding the applicability of N,P-CQDs in the field of life science.