Does Metformin Cause Insomnia or Sleep Problems?

Metformin is not a well-established cause of insomnia, and the weight of clinical evidence suggests it is more likely to leave sleep unchanged or even modestly improve it than to disrupt it. A large analysis of UK Biobank data found no significant difference in difficulty falling or staying asleep between metformin users and people with diabetes who took no medication at all. That said, rare reports of vivid dreams and nightmares do exist, and the relationship between metformin, blood sugar, and sleep is tangled enough that some people on the drug genuinely do sleep worse, even if the drug itself may not be the main reason.

What Large-Scale Data Actually Show

The best population-level look at metformin and sleep comes from a study of thousands of people with type 2 diabetes drawn from the UK Biobank. Researchers compared sleep complaints across three groups: people taking metformin, people taking other diabetes medications, and people with diabetes who were not on any antidiabetic drug. After adjusting for age, sex, body mass index, and other health factors, metformin users were statistically indistinguishable from untreated patients when it came to trouble falling or staying asleep. The group that did report more sleep difficulty was the one taking non-metformin antidiabetics, who had roughly 1.24 times the odds of regular sleep complaints compared to both the untreated group and the metformin group.1Frontiers in Endocrinology. Oral Antidiabetics and Sleep Among Type 2 Diabetes Patients: Data From the UK Biobank

A separate cross-sectional study looking at the psychiatric side-effect profiles of various diabetes medications found no significant association between metformin use and any psychiatric outcome, including poor sleep quality. In contrast, SGLT-2 inhibitors, a newer class of diabetes drug, were linked to roughly double the odds of poorer sleep quality.2PubMed Central. Association of antidiabetic medications with psychiatric disorders in patients with type 2 diabetes: a cross-sectional study These findings do not prove metformin is sleep-friendly, but they consistently show it is not the problem drug in the diabetes medicine cabinet when it comes to nighttime rest.

Evidence That Metformin Can Improve Sleep

Some research goes further than neutral and suggests metformin actively helps sleep. In a year-long randomized trial of people with metabolic syndrome, those assigned to metformin showed significant improvements in actual sleep time and sleep efficiency compared to those on placebo. The placebo group, meanwhile, saw their sleep quality and quantity get worse over the same period.3Frontiers in Nutrition. Sleep behavior and daily activity levels in people with metabolic syndrome: effect of 1 year of metformin treatment That trial used actigraphy, which is a wrist-worn device that objectively measures sleep, so the results were not just based on people’s subjective reports.

A narrative review examining metformin and sleep health in older adults with type 2 diabetes identified four plausible biological pathways through which the drug could improve sleep: stabilizing blood sugar enough to reduce nighttime trips to the bathroom, calming brain inflammation through an enzyme pathway called AMPK, influencing the expression of genes that regulate the body’s internal clock, and protecting the brain circuits responsible for sleep regulation as people age.4PubMed. Metformin and sleep health in older adults with type 2 diabetes: Mechanisms, clinical evidence, and future directions, a narrative review The review noted that the most noticeable improvements tended to appear in people who already had poor sleep at baseline. If you are sleeping well, you probably will not notice a change. If you are sleeping badly, metformin may quietly help.

The catch is that most of this evidence comes from observational studies or small trials that were not specifically designed to measure sleep as their primary outcome. No large randomized trial has been set up purely to answer the question “does metformin improve sleep?” So while the direction of the evidence is encouraging, the strength is still moderate at best.

The Rare Exception: Vivid Dreams and Nightmares

Despite the generally reassuring picture, a small number of people do report disturbing sleep experiences after starting metformin. One published case involved a 56-year-old man with no prior history of sleep disorders who began having nightmares and abnormally vivid dreams immediately after starting 750 mg of extended-release metformin. The dreams were vivid enough to wake him. When he stopped the medication, the dreams stopped. When the drug was restarted as a test, the dreams came back.5Hindawi / PubMed Central. Nightmare and Abnormal Dreams: Rare Side Effects of Metformin? That pattern of disappearance and recurrence strongly suggests the drug was the cause in that particular person.

A 2012 report also flagged sleep deterioration as a potentially underrecognized side effect of metformin, though it did not specify how common it was or which populations were most vulnerable.6PubMed Central. Metformin and sleep disorders The narrative review of older adults characterized vivid dreams and nightmares as “uncommon” and noted they generally resolve with a dose adjustment rather than requiring the drug to be stopped entirely.4PubMed. Metformin and sleep health in older adults with type 2 diabetes: Mechanisms, clinical evidence, and future directions, a narrative review

So if you have started metformin and your dreams have suddenly become more intense, more frequent, or disturbing enough to wake you, you are not imagining things and you are not alone. But you are in a small minority. For most people, this does not happen.

Blood Sugar Swings and Nighttime Waking

One of the more overlooked reasons people on metformin wake up at night has nothing to do with the drug’s direct effects on the brain. Poorly controlled blood sugar itself is a major sleep disruptor. High blood sugar increases urine production, leading to multiple bathroom trips. Low blood sugar triggers adrenaline and cortisol release, which can jolt you awake with a racing heart, sweating, or anxiety.

Metformin is rarely the sole cause of dangerous low blood sugar on its own, because it works mainly by reducing how much glucose the liver releases rather than by forcing the pancreas to produce extra insulin. But when metformin is combined with other medications that do push insulin production, like sulfonylureas or insulin itself, the risk of nighttime hypoglycemia rises. One case report described a patient on a combination of insulin, metformin, and glimepiride whose blood sugar dropped to 35 mg/dL during the night, triggering bizarre and destructive behavior including ripping fixtures off walls.7PubMed Central. Abnormal nocturnal behavior due to hypoglycemia: A case report That extreme scenario was driven by the combination, not metformin alone, but it illustrates how nighttime glucose crashes can profoundly disrupt sleep and behavior.

If you are waking up feeling sweaty, jittery, or suddenly alert in the middle of the night, the question worth asking your doctor is not “is metformin keeping me up?” but “are my blood sugars stable overnight?” A continuous glucose monitor or even a simple fingerstick before bed and upon waking can provide useful clues.

When Another Diabetes Drug Is the Real Culprit

Because people with type 2 diabetes often take multiple medications, it is easy to blame metformin for sleep trouble that is actually caused by something else in the regimen. The UK Biobank study found that patients on non-metformin antidiabetics had significantly higher odds of reporting difficulty falling and staying asleep compared to both metformin users and untreated patients.1Frontiers in Endocrinology. Oral Antidiabetics and Sleep Among Type 2 Diabetes Patients: Data From the UK Biobank And the cross-sectional psychiatric study specifically singled out SGLT-2 inhibitors as being associated with about twice the odds of poor sleep quality, while metformin showed no such link.2PubMed Central. Association of antidiabetic medications with psychiatric disorders in patients with type 2 diabetes: a cross-sectional study

SGLT-2 inhibitors work by causing the kidneys to excrete excess glucose into the urine, which means increased urination, particularly at night. That mechanism alone could explain much of the sleep disruption associated with the drug class. Sulfonylureas, meanwhile, can cause hypoglycemia, especially overnight, as described in the previous section. If your sleep problems coincide with starting a new medication alongside metformin, or with a dose change in a different drug, it is worth investigating that medication first.

Metformin and Sleep in Polycystic Ovary Syndrome

Metformin is widely prescribed off-label for polycystic ovary syndrome, and sleep disturbances are common in that population. A study of adolescent girls with PCOS found that metformin treatment significantly reduced scores on both a sleep disturbance scale and a daytime sleepiness scale compared to an untreated PCOS group.8PubMed. Effect of metformin on sleep disorders in adolescent girls with polycystic ovarian syndrome The improvements came alongside reductions in weight, insulin resistance, and other metabolic markers, so it is hard to separate metformin’s direct effect on sleep from the indirect benefit of improving the underlying metabolic dysfunction that was interfering with sleep in the first place.

That distinction matters. In PCOS, insulin resistance contributes to elevated androgens, which contribute to weight gain and fat deposition around the airway, which increases the risk of obstructive sleep apnea, which causes daytime sleepiness and fragmented sleep. By tackling insulin resistance at the root, metformin may improve sleep through a cascade of downstream metabolic improvements rather than through any direct action on sleep centers in the brain. For people taking metformin for PCOS specifically, the drug is likely helping sleep rather than hurting it.

How Metformin Interacts With the Body Clock

One of the more interesting findings in this area is that metformin appears to directly influence circadian biology. An animal study found that metformin activated enzymes called casein kinases in both liver and muscle tissue, which are known regulators of the body’s circadian clock. The effect was tissue-specific: the drug caused clock genes and metabolic genes to shift earlier in the liver and later in the muscle.9PubMed. Metformin affects the circadian clock and metabolic rhythms in a tissue-specific manner

What this means for human sleep is still unclear. The circadian clock governs not just when you feel sleepy but also when your liver processes glucose, when your muscles burn fuel, and when hormones like cortisol and melatonin peak. If metformin is subtly reprogramming the timing of these processes, it could in theory make some people feel more alert at the wrong time or drowsy at the wrong time, depending on individual biology and when the dose is taken. This is speculative, and no one has shown a clean link between metformin’s clock-gene effects and subjective sleep quality in humans. But it hints at why the occasional person might notice a change in their sleep pattern even though most people notice nothing.

Animal research has also explored combining metformin with melatonin and found the two worked together to counteract some metabolic harm caused by circadian disruption.10Oxford Academic. Administration of Melatonin and Metformin Prevents Deleterious Effects of Circadian Disruption and Obesity in Male Rats That does not mean you should start taking melatonin with your metformin, but it does suggest that researchers see the two substances as working in overlapping biological territory when it comes to metabolic timing.

Does Metformin Help With Sleep Apnea?

Obstructive sleep apnea is extremely common in people with type 2 diabetes. Because metformin can promote modest weight loss and improve metabolic health, there has been hope that it might also reduce sleep apnea. The evidence so far is disappointing on that front. A study looking at metformin use and sleep apnea prevalence found no significant association between the two. Metformin users were neither more nor less likely to have sleep apnea than non-users.11PubMed Central. The Relationship between Metformin and Obstructive Sleep Apnea

The researchers noted that while metformin might still improve subjective sleep quality through other mechanisms, it does not appear to reduce the likelihood of developing sleep apnea. If you have been diagnosed with sleep apnea or suspect you have it based on symptoms like loud snoring, gasping during sleep, or crushing daytime fatigue, metformin is not a substitute for standard treatment. But at least the drug does not appear to make sleep apnea worse, either.

Practical Steps if You Are Sleeping Poorly on Metformin

If your sleep has deteriorated since starting metformin, a few practical angles are worth exploring before assuming the drug is at fault.

  • Timing: Some people find that taking metformin with their evening meal causes more GI discomfort at bedtime, which can delay sleep onset. Shifting the larger dose to the morning, or switching to the extended-release formulation, sometimes helps.
  • Blood sugar: Check whether your overnight glucose is stable. Wild swings, either high or low, can fragment sleep in ways that feel like insomnia but are actually metabolic.
  • Other medications: Review the rest of your regimen. Sulfonylureas, SGLT-2 inhibitors, and insulin all have clearer associations with nighttime sleep disruption than metformin does.
  • Vivid dreams: If the problem is specifically bizarre or disturbing dreams that started right after beginning metformin, mention it to your prescriber. A dose reduction often resolves it without needing to stop the drug entirely.
  • Underlying conditions: Diabetes itself, obesity, depression, and sleep apnea all independently damage sleep quality. Treating or managing those conditions often does more for sleep than any medication change.

The gastrointestinal side effects that metformin is famous for, including nausea, bloating, and diarrhea, can also indirectly affect sleep if they are bad enough to cause discomfort at night. These side effects are most common in the first few weeks of treatment and often improve with time, especially with the extended-release version of the drug. If stomach trouble is keeping you up, it may be worth waiting it out before concluding that metformin and your sleep are fundamentally incompatible.

Why the Reputation Persists

Given that the data mostly exonerates metformin, it is reasonable to wonder why so many online forums and patient communities blame it for sleep problems. Part of the answer is timing. People start metformin when their diabetes or metabolic syndrome is diagnosed, which is often a period when their health is worsening in multiple ways simultaneously. Sleep may already be deteriorating because of weight gain, worsening insulin resistance, undiagnosed sleep apnea, or the stress and anxiety that come with a new diagnosis. Metformin is the new variable, so it gets the blame.

There is also a selection effect in online health discussions. People who start metformin and sleep fine have no reason to post about it. People who start metformin and sleep badly search for answers and find threads full of other people who had the same experience, creating the impression that sleep disruption is common. Pharmacovigilance databases, which collect spontaneous reports of side effects, reflect this same bias: they capture who reported a problem, not how many people did not have one.

None of this means your experience is invalid if you are struggling. It means the cause may be worth investigating more carefully rather than stopping a medication that, for many people with metabolic disease, provides real long-term cardiovascular and metabolic benefits. For the small number of people who do experience metformin-specific sleep effects like nightmares, the problem is real and documented. For most others, the culprit is more likely hiding somewhere else in the picture.