The above experimental findings clearly suggest an electrochemical transformation of melamine to g-C3N4 QDs using BMIMBF4 ionic liquid as an electrolyte with possible size tuning by varying the electric field. TEM images reveal the formation of QDs of various sizes, supplemented by the graphitic peak in P-XRD and graphitic nitrogen from the XPS data.