A rapid, green and sensitive technique for the determination of metformin determination was developed based on the direct fluorescence enhancement of carbon dots (CDs) induced by the cited drug. The water‐soluble CDs were prepared via a one‐pot synthesis from avocado peels using domestic microwave. The prepared CDs exhibited strong fluorescence at 405 nm after excitation at 320 nm with a quantum yield of 51%. The fluorescence of CDs was enhanced linearly by increasing the concentration of metformin within the range 0.5–25 μg/mL with limit of detection 0.087 μg/mL and limit of quantification 0.263 μg/mL. The designed probe was proved to be selective toward metformin in the presence of other drugs such as vildagliptin and alogliptin and also in the presence of excipients in the pharmaceutical dosage form. The suggested and reported methods were compared with the help of the whiteness and greenness tools, specifically the white analytical chemistry and analytical greenness metric tools, for assessing hazardous solvents and reagents used.