Ascorbic acid (AA), a critical cellular metabolite involved in many biochemical pathways, is an important antioxidant in human body. Therefore, it is of great significance to monitor AA in living cells. Nowadays, there are various technologies developed for the detection of AA, but few methods could sensitively and selectively detect the intracellular AA. Here, we reported a highly efficient biosensor (g-C3N4-CoOOH nanocomposite) based on ultrathin graphitic carbon nitride (g-C3N4) nanosheets and CoOOH nanoflakes, for sensitive detection and fluorescence imaging of AA in living cell. The g-C3N4 used here as fluorescence donor is a promising bioimaging nanomaterial because of their high fluorescence quantum yield, good biocompatibility and low toxicity. In addition, the CoOOH was used to be perfect fluorescence quencher. Herein, we enabled the CoOOH in situ to form a layer on the surface of g-C3N4, resulting in fluorescence quench of the g-C3N4. Upon the addition of AA, the CoOOH nanoflakes were reduced to Co2+, and the system gave a "turn on" fluorescence signal. It developed as an efficient sensing platform for AA, and the linear range was from 5 to 50μM with a 1.6μM detection limit. This novel biosensor, g-C3N4-CoOOH nanocomposite exhibited highly selective response toward AA relative to other biomolecules. Furthermore, this biosensor was used successfully to visualize and monitor AA in living cells. Hopefully, we believe that this biosensor would provide a low-cost and highly sensitive platform for AA detection and bioimaging. Schematic illustration of the sensing strategy based on the g-C3N4-CoOOH nanocomposite for AA detection.