Metformin, a biguanide derivative that is widely used for treating type 2 diabetes mellitus, has recently been shown to exert potential anticancer effects. Many retrospective data and laboratory studies suggest the idea that metformin has antineoplastic activity, but some other studies reach conflicting conclusions. Although the precise molecular mechanisms by which metformin affects various cancers have not been fully elucidated, activation of AMPK-dependent and AMPK-independent pathways along with energy metabolism aberration, cell cycle arrest and apoptosis or autophagy induction have emerged as crucial regulators in this process. In this Review, we describe the role of metformin in the prevention and treatment of a variety of cancers and summarize the molecular mechanisms that are currently well documented in the ability of metformin as an anticancer agent. In addition, the scientific and clinical hurdles regarding the potential role of metformin in cancer will be discussed.