Earlier, Wang et al. synthesised oxygen and sulphur-co-doped carbon nitride quantum dots from bulk OS-co-doped carbon nitride through a combination of hydrothermal-electrochemical approaches . Hence, there is a necessity for the preparation of carbon nitride quantum dots by electrochemical methods only. Herein, we report the electrosynthesis of carbon nitride quantum dots in ionic liquid at room temperature. The optical properties exhibited by these QDs are due to the quantum confinement effect, and the electronic properties can be influenced by size, shape, and the degree of surface functionalization. Herein, varying the size resulted in a tunable band gap. Urea is often used as the nitrogen source, while sodium citrate, citric acid, and ammonium citrate are used as carbon sources to prepare g-C3N4 QDs. Melamine, a nitrogen-rich (67%) and inexpensive material, is a perfect match for electrochemical exfoliation.