Strongly blue fluorescent N-doped carbon dots (CDs) were synthesized by using citric acid (CA) as the carbon source and diethylenetriamine (DETA) as the nitrogen source using a one-step hydrothermal method. Several synthetic parameters, including the molar ratios of initial starting materials, the temperature and time of hydrothermal reaction, were investigated and optimized. The range and average value of the diameters of the resultant CDs were 1.2–4.0 nm and 2.3 nm, respectively. The synthesized CDs display fluorescence with excitation/emission maxima of 391/438 nm and a quantum yield of 58%. Fluorescence is quenched by Co(II) ions, and this effect was exploited to design a method for determination of Co(II) in water and to image it in living HeLa (cervical carcinoma) cells. The limit of detection and linear range of Co2+ using the synthesized CDs as fluorescence probe are 0.4 μmol·L−1 and 0–90 μmol·L−1, respectively. Due to the selective and sensitive response of Co2+, the CDs possess potential applications in biological labeling for the demands such as monitoring the distribution of vitamin B-12 or other cobalt-containing medicines in cells or organisms.