The evidence of metformin’s effect on dementia is conflicting. This study investigates the association between metformin use and the risk of dementia among patients with diabetes mellitus (DM). This study included patients with new-onset DM between 2002 and 2013. We divided the patients into patients who used metformin and patients who did not. Two models were used to assess metformin use: the cumulative defined daily dose (cDDD) of metformin use and the intensity of metformin use. This study with 3-year and 5-year follow-ups investigated the risk of dementia among patients with DM who used metformin. At the 3-year follow-up, patients who received cDDD < 300 had an odds ratio (OR) of developing dementia of 0.92 (95% confidence interval [CI] = 0.89–0.96); patients who used metformin at intensities <10 and 10–25 DDD/month had ORs of 0.92 (95% CI: 0.87–0.97) and 0.92 (95% CI: 0.85–1.00), respectively. Metformin use at cDDD 300–500 (OR = 0.80, 95% CI = 0.56–1.15) or >500 (OR = 1.48, 95% CI = 0.48–4.60) or at an intensity >25 DDD/month (OR = 0.84, 95% CI = 0.60–1.18) were not associated with an incident of dementia. There were similar results at the 5-year follow-up. Patients with a low intensity of metformin use had a lower risk of dementia. However, higher doses of metformin with higher intensity exhibited no protective role in dementia. Prospective clinical trials are warranted to evaluate the actual underlying mechanisms between metformin dosage and the risk of dementia.