Graphitic carbon nitride nanodots (g-C3 N4 nanodots), as a new kind of heavy-metal-free quantum dots, have attracted considerable attention because of their unique physical and chemical properties. Although various methods to obtain g-C3 N4 nanodots have been reported, it is still a challenge to synthesize g-C3 N4 nanodots with ultrahigh fluorescence quantum yield (QY). In this study, highly fluorescent phosphorus/oxygen-doped graphitic carbon nitride (P,O-g-C3 N4 ) nanodots were prepared by chemical oxidation and hydrothermal etching of bulk P-g-C3 N4 derived from the pyrolysis of phytic acid and melamine. The as-prepared P,O-g-C3 N4 nanodots showed strong blue fluorescence and a relatively high QY of up to 90.2 %, which can be ascribed to intrinsic phosphorus/oxygen-containing groups, and surface-oxidation-related fluorescence enhancement. In addition, the P,O-g-C3 N4 nanodots were explored for cell imaging with excellent stability and biocompatibility, which suggest that they have great potential in biological applications.