Metformin is the first-line medication for the treatment of type 2 diabetes,particularly in people who are overweight. It is also used in the treatment of polycystic ovary syndrome (PCOS). Limited evidence suggests metformin may prevent the cardiovascular disease and cancer complications of diabetes. It is not associated with weight gain. It is taken by mouth.