In this work, we fabricated cobalt-doped carbon quantum dots (Co-CQDs) by a one-pot hydrothermal method with cobalt tetraphenylporphyrin and 1,2-ethanediamine as precursors. The morphology and structure of the Co-CQDs were characterized through transmission electron microscopy, X-ray diffraction spectra, Fourier transform infrared, and X-ray photoelectron spectra. The Co-CQDs emitted intense blue luminescence under ultraviolet irradiation and exhibited a typical excitation-dependent emission property. Moreover, they can act as a fluorescent probe for the detection of Fe 3+ and ascorbic acid (AA) with high selectivity and sensitivity through an "on-off-on" mode. The limit of detection (LOD) of Fe 3+ was measured as 38 μM (S/N = 3). The quenched emission of carbon quantum dots can be recovered with the addition of ascorbic acid (AA) to the Co-CQDs/Fe 3+ system. The change of fluorescence was linear with the concentration of AA (0.6-1.6 mM) with the LOD of 18 μM. Furthermore, the Co-CQDs exhibited high oxidase-like catalytic behavior, which could convert transparent 3,3',5,5'-tetramethylbenzidine (TMB) into blue ox-TMB by dissolved oxygen. After adding ascorbic acid to the Co-CQDs/TMB system, the blue color of the solution faded due to the reduction of blue ox-TMB to colorless TMB. Based on this phenomenon, the Co-CQDs were capable of detecting AA (10-400 μM) with the LOD of 0.27 μM. The fluorometric and colorimetric assays based on the Co-CQDs for the AA detection were then successfully applied in fresh fruits. Furthermore, the high biocompatibility of the Co-CQDs against HeLa cells was verified by the 3-(4,5-dimethylthiazol-2-yl)-2,5-diphenyltetrazolium bromide (MTT) method. Thus, the Co-CQDs could be used as a powerful tool for the detection of AA in real samples through a dual-mode method.