This article describes a simple synthesis of two types of carbon dots (CDs) from glucose (g-CDs) and citric acid (ca-CDs) using the hydrothermal treatment method. At the synthesis the water solution of ammonia was used for doping of the g-CDs and ca-CDs by N for improving their electronic and transport properties. These synthesized CDs consist mostly of 1-4 layers having a uniform size of about 14 nm, and the nitrogen atoms were successfully introduced into the lattice of CDs. The resulting CDs have a crystalline structure with functional groups on the surface and exhibit bright photoluminescence in the violet-blue region of the spectrum. The g-CDs exhibit an excitation-dependent blue emission, in the case of ca-CDs their emission dependence on excitation is not clearly observed. The obtained CDs have a number of advantages and can be widely used for the creation of photodetectors, detectors for chemical elements and various optoelectronic applications.