Nitrogen-doped carbon nanodots (CDs) were prepared via the solvothermal method, using urea and triethylene glycol as the starting materials. The as-prepared CDs had individual diameters of approximately 100 nm and were in clusters of different sizes. The surface composition and optical properties of the as-prepared CDs were characterized. They exhibited multicolor emission properties in the visible range when excited with a wide wavelength range. The aqueous solution of the CDs was used in highly sensitive tartrazine determination. The fluorescence quenching of the CDs was in a linear relationship with the concentrations of tartrazine in the range of 0.5-30.0 mu M. The detection limit of the assay was 0.18 mu M. Acceptable recovery results were obtained via spike-recovery experiments on cookie samples.