Melamine is an organic base with the chemical formulaC3H6N6, with the IUPAC name1,3,5-triazine-2,4,6-triamine. It is only slightly soluble in water.Melamine is a trimer ofcyanamide. Like cyanamide, it is 66% nitrogen (by mass) and provides fire retardantproperties to resin formulas by releasing nitrogen when burned or charred. Dicyandiamide (or cyanoguanidine), the dimer ofcyanamide, is also used as a fire retardant.

Melamine is a metabolite of cyromazine, a pesticide.