Metformin may reduce the incidence of breast cancer and enhance response to neoadjuvant chemotherapy in diabetic women. This trial examined the effects of metformin on Ki67 and gene expression in primary breast cancer. Non-diabetic women with operable invasive breast cancer received pre-operative metformin. A pilot cohort of eight patients had core biopsy of the cancer at presentation, a week later (without treatment; internal control), then following metformin 500-mg o.d. for 1 week increased to 1-g b.d. for a further week continued to surgery. A further 47 patients had core biopsy at diagnosis were randomized to metformin (the same dose regimen) or no drug, and 2 weeks later had core biopsy at surgery. Ki67 immunohistochemistry, transcriptome analysis on formalin-fixed paraffin-embedded cores and serum insulin determination were performed blinded to treatment. Seven patients (7/32, 21.9%) receiving metformin withdrew because of gastrointestinal upset. The mean percentage of cells staining for Ki67 fell significantly following metformin treatment in both the pilot cohort (P = 0.041, paired t-test) and in the metformin arm (P = 0.027, Wilcoxon rank test) but was unchanged in the internal control or metformin control arms. Messenger RNA expression was significantly downregulated by metformin for PDE3B (phosphodiesterase 3B, cGMP-inhibited; a critical regulator of cAMP levels that affect activation of AMP-activated protein kinase, AMPK), confirmed by immunohistochemistry, SSR3, TP53 and CCDC14. By ingenuity pathway analysis, the tumour necrosis factor receptor 1 (TNFR1) signaling pathway was most affected by metformin: TGFB and MEKK were upregulated and cdc42 downregulated; mTOR and AMPK pathways were also affected. Gene set analysis additionally revealed that p53, BRCA1 and cell cycle pathways also had reduced expression following metformin. Mean serum insulin remained stable in patients receiving metformin but rose in control patients. This trial presents biomarker evidence for anti-proliferative effects of metformin in women with breast cancer and provides support for therapeutic trials of metformin.